Skip to content

Commit

Permalink
Bugfix/ipad 519 2 (#31)
Browse files Browse the repository at this point in the history
* update line 432 - use is.na instead of is.character

* use all instead of sum with is.na

* write checkNumberRowsNA
  • Loading branch information
ElyseGeoffroy authored Jan 24, 2025
1 parent 00e3db4 commit 229d438
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions R/check.R
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,14 @@ checkPlots <- function(plots) {
return(NULL)
}

checkNumberRowNAs <- function(row) {
if(sum(is.na(row))) {
return(TRUE)
} else {
return(FALSE)
}
}

checkMapping <- function(mapping) {
checkList(mapping)

Expand All @@ -429,10 +437,7 @@ checkMapping <- function(mapping) {
stop("mapping object requires at least two models and one feature")
}
# stop if mapping object has all NAs for a given model
# if (!(sum(vapply(mapping[[i]], is.na, logical(1))) == ncol(mapping[[i]]))) {
# stop("mapping object requires at least one feature per model")
# }
if (!(all(vapply(mapping[[i]], is.na, logical(1))))) {
if (!(sum(vapply(mapping[[i]], function(x) checkNumberRowNAs(x), logical(1))))) {
stop("mapping object requires at least one feature per model")
}
# check if any given model has at least one feature aligned with another model
Expand Down

0 comments on commit 229d438

Please sign in to comment.