From 134c2fdc70ac64c581532776d3e38cfbd922d6ae Mon Sep 17 00:00:00 2001 From: maltelueken Date: Fri, 27 Oct 2023 10:19:06 +0200 Subject: [PATCH] Fix error handling to prevent .subset2 error message --- R/classicProcess.R | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/R/classicProcess.R b/R/classicProcess.R index 041d476..a8584b4 100644 --- a/R/classicProcess.R +++ b/R/classicProcess.R @@ -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 @@ -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) }