Commit 42de0869 authored by Corson N. Areshenkoff's avatar Corson N. Areshenkoff

Fix payoff query

parent a843aa75
......@@ -3,7 +3,7 @@ Type: Package
Title: Iowa Gambling Task data from 617 healthy subjects
Version: 0.1.0
Author: Corson N. Areshenkoff
Maintainer: areshenk@protonmail.com
Maintainer: Corson N. Areshenkoff <areshenk@protonmail.com>
Description: Interface to the open IGT dataset published by Steingroever et al. (2015)
License: Creative Commons Attribution Share Alike 4.0
Encoding: UTF-8
......
......@@ -7,6 +7,8 @@ openigt.query <- function(study = NULL, payoff = NULL,
}
if (is.null(payoff)) {
payoff <- levels(igtdata$legend$Payoff)
} else {
payoff <- as.character(payoff)
}
if (is.null(trials)) {
trials <- range(igtdata$legend$Trials, na.rm = T)
......@@ -23,9 +25,9 @@ openigt.query <- function(study = NULL, payoff = NULL,
igtdata$legend$Payoff %in% payoff &
igtdata$legend$Trials >= trials[1] &
igtdata$legend$Trials <= trials[2] &
igtdata$legend$Age >= age[1] &
igtdata$legend$Age <= age[2] |
(age.null & is.na(igtdata$legend$Age)))
((igtdata$legend$Age >= age[1] &
igtdata$legend$Age <= age[2]) |
(age.null & is.na(igtdata$legend$Age))))
# Truncate data, if requested
if (trim) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment