Skip to content

Commit

Permalink
Bugfix/ipad 519 2 (#32)
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

* use transpose and vapply
  • Loading branch information
ElyseGeoffroy authored Jan 24, 2025
1 parent 229d438 commit 6f66b91
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions R/check.R
Original file line number Diff line number Diff line change
Expand Up @@ -417,10 +417,10 @@ checkPlots <- function(plots) {
}

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

Expand All @@ -437,7 +437,8 @@ 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]], function(x) checkNumberRowNAs(x), logical(1))))) {
tdf<-as.data.frame(t(mapping[[i]]))
if(!all(vapply(tdf, 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 6f66b91

Please sign in to comment.