Skip to content

Commit

Permalink
Fix error handling to prevent .subset2 error message
Browse files Browse the repository at this point in the history
  • Loading branch information
maltelueken committed Oct 27, 2023
1 parent e79e21c commit 134c2fd
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions R/classicProcess.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ClassicProcess <- function(jaspResults, dataset = NULL, options) {
# Read dataset
dataset <- .procReadData(options)
# Check for errors in dataset
ready <- .procErrorHandling(dataset, options)
.procErrorHandling(dataset, options)
# Create a container for each model
.procContainerModels(jaspResults, options)
# Transform input for each model into a graph for further processing
Expand Down Expand Up @@ -544,12 +544,16 @@ ClassicProcess <- function(jaspResults, dataset = NULL, options) {
}

.procErrorHandling <- function(dataset, options) {
# See error handling
vars <- lapply(.procGetDependencies(), function(x) options[[x]])
.hasErrors(dataset, "run", type = c('observations', 'variance', 'infinity'),
all.target = vars,
observations.amount = '< 2',
exitAnalysisIfErrors = TRUE)
.hasErrors(dataset, "run",
type = c('observations', 'variance', 'infinity'),
all.target = c(
options[["dependent"]],
options[["covariates"]],
options[["factors"]]
),
observations.amount = '< 2',
exitAnalysisIfErrors = TRUE
)

return(TRUE)
}
Expand Down

0 comments on commit 134c2fd

Please sign in to comment.