Skip to content

Commit

Permalink
Preventing error when analysisToExclude is empty but not NULL
Browse files Browse the repository at this point in the history
  • Loading branch information
Admin_mschuemi authored and Admin_mschuemi committed Nov 2, 2023
1 parent bcd6320 commit 5a036bb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/RunAnalyses.R
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ createReferenceTable <- function(sccsAnalysisList,
referenceTable$sccsModelFile <- generateFileName(1:nrow(referenceTable))

# Remove rows that the user specified to exclude ---------------------------------
if (!is.null(analysesToExclude)) {
if (!is.null(analysesToExclude) && nrow(analysesToExclude) != 0) {
matchingColumns <- colnames(analysesToExclude)[colnames(analysesToExclude) %in% c("exposureId", "outcomeId", "analysisId", "nestingCohortId")]
if (length(matchingColumns) == 0) {
stop("The 'analysesToExclude' argument should contain columns 'exposureId', 'outcomeId', or 'analysisId'.")
Expand Down

0 comments on commit 5a036bb

Please sign in to comment.