Skip to content

Commit 0d045f2

Browse files
authored
Updates for preloadData (jasp-stats#2)
* Update preloaddata * Updates * Update * Update itemresponsetheorycommon.R
1 parent a29cb6d commit 0d045f2

34 files changed

+576
-573
lines changed

R/classicaltesttheory.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#
1717

1818
classicalTestTheory <- function(jaspResults, dataset, options, ...) {
19-
dataset <- .irtReadData(options)
19+
dataset <- .irtReadData(dataset, options)
2020
ready <- .irtReady(options)
2121

2222
# Create the summary table

R/itemresponsetheorycommon.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@
3535
return(deps)
3636
}
3737

38-
.irtReadData <- function(options) {
38+
.irtReadData <- function(dataset, options) {
3939
variables <- unlist(options[["items"]])
4040
variables <- variables[variables != ""]
4141
covariates <- unlist(options[["covariates"]])
4242
if (length(covariates) > 0) {
4343
variables <- c(variables, covariates)
4444
}
45-
dataset <- .readDataSetToEnd(columns.as.numeric = variables)
45+
dataset <- jaspBase::excludeNaListwise(dataset, variables)
4646
.hasErrors(dataset,
4747
type = c("infinity", "observations"),
4848
all.target = c(options[["items"]], options[["covariates"]]),
@@ -467,7 +467,7 @@
467467
}
468468

469469
.irtIRTItemCharCurve <- function(dataset, options, jaspResults, ready, position) {
470-
if (options[["explanatoryText"]] && options[["plotItemCharacteristic"]]) {
470+
if (options[["explanatoryText"]] && length(options[["plotItemCharacteristicItems"]] > 0)) {
471471
text <- createJaspHtml(gettext("<h3>Explanatory Text: Item Characteristic Curves</h3>An item characteristic curve (ICC) plot shows how different test questions or items perform. It is like a graph that helps us understand how easy or hard each question is and how likely people with different abilities are to answer them correctly. In the figure, you can see a line for each question, and the shape of the line tells you if the question is easy or difficult to answer fully correctly as a function of the ability of a respondent."))
472472
text$position <- position
473473
text$dependOn(options = c("explanatoryText", "plotItemCharacteristicItems"))

R/itemresponstheorydichotomous.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
itemResponseTheoryDichotomous <- function(jaspResults, dataset, options, ...) {
1919
# Preliminary work
20-
dataset <- .irtReadData(options)
20+
dataset <- .irtReadData(dataset, options)
2121
ready <- .irtReady(options)
2222
.irtIRTErrorHandling(dataset, options)
2323

R/itemresponstheorydichotomousbayesian.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
itemResponseTheoryDichotomousBayesian <- function(jaspResults, dataset, options, ...) {
1919
# Preliminary work
20-
dataset <- .irtReadData(options)
20+
dataset <- .irtReadData(dataset, options)
2121
ready <- .irtReady(options)
2222
.irtIRTErrorHandling(dataset, options)
2323

R/itemresponstheorypolytomous.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
itemResponseTheoryPolytomous <- function(jaspResults, dataset, options, ...) {
1919
# Preliminary work
20-
dataset <- .irtReadData(options)
20+
dataset <- .irtReadData(dataset, options)
2121
ready <- .irtReady(options)
2222
.irtIRTErrorHandling(dataset, options)
2323

R/itemresponstheorypolytomousbayesian.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
itemResponseTheoryPolytomousBayesian <- function(jaspResults, dataset, options, ...) {
1919
# Preliminary work
20-
dataset <- .irtReadData(options)
20+
dataset <- .irtReadData(dataset, options)
2121
ready <- .irtReady(options)
2222
.irtIRTErrorHandling(dataset, options)
2323

inst/Description.qml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Description
1414
website : "https://github.com/jasp-stats/jaspIrt"
1515
license : "GPL (>= 3)"
1616
hasWrappers : false
17+
preloadData : true
1718

1819
GroupTitle
1920
{

inst/qml/classicalTestTheory.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Form
3939
{
4040
name: "items"
4141
title: qsTr("Item Scores")
42-
allowedColumns: ["nominal", "ordinal", "scale"]
42+
allowedColumns: ["scale"]
4343
info: qsTr("Select the variables representing item scores for the analysis.")
4444
}
4545
}

inst/qml/common/dichotomous/VariablesListDichotomous.qml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ VariablesForm
3737
id: items
3838
name: "items"
3939
title: qsTr("Item Responses")
40-
allowedColumns: ["nominal"]
40+
allowedColumns: ["scale"]
4141
info: qsTr("Select the variables representing item responses for the analysis.")
4242
}
4343

@@ -46,7 +46,7 @@ VariablesForm
4646
id: covariates
4747
name: "covariates"
4848
title: qsTr("Person Covariates")
49-
allowedColumns: ["nominal", "ordinal", "scale"]
49+
allowedColumns: ["nominal", "scale"]
5050
implicitHeight: 125 * preferencesModel.uiScale
5151
info: qsTr("Select the variables representing the person-level covariates for the analysis.")
5252
}

inst/qml/common/polytomous/VariablesListPolytomous.qml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ VariablesForm
3737
id: items
3838
name: "items"
3939
title: qsTr("Item Responses")
40-
allowedColumns: ["nominal", "ordinal"]
40+
allowedColumns: ["nominal"]
4141
info: qsTr("Select the variables representing item responses for the analysis.")
4242
}
4343

@@ -46,7 +46,7 @@ VariablesForm
4646
id: covariates
4747
name: "covariates"
4848
title: qsTr("Person Covariates")
49-
allowedColumns: ["nominal", "ordinal", "scale"]
49+
allowedColumns: ["nominal", "scale"]
5050
implicitHeight: 125 * preferencesModel.uiScale
5151
info: qsTr("Select the variables representing the person-level covariates for the analysis.")
5252
}

0 commit comments

Comments
 (0)