Skip to content

Commit

Permalink
continue to improve messaging
Browse files Browse the repository at this point in the history
  • Loading branch information
d-callan committed Apr 30, 2024
1 parent 808e1f1 commit 35b6ab7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions R/method-correlation.R
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,17 @@ function(
if (!identical(veupathUtils::findNumericCols(data1), names(data1))) {
warning("All columns in data1 are not numeric. Only numeric columns will be used.")
keepCols <- veupathUtils::findNumericCols(data1)
if (length(keepCols) == 0) {
stop("No numeric columns found in data1.")
}
data1 <- data1[, ..keepCols]
}
if (!identical(veupathUtils::findNumericCols(data2), names(data2))) {
warning("All columns in data2 are not numeric. Only numeric columns will be used.")
keepCols <- veupathUtils::findNumericCols(data2)
if (length(keepCols) == 0) {
stop("No numeric columns found in data2.")
}
data2 <- data2[, ..keepCols]
}

Expand Down Expand Up @@ -186,6 +192,9 @@ function(
if (!identical(veupathUtils::findNumericCols(data1), names(data1))) {
warning("All columns in data1 are not numeric. Only numeric columns will be used.")
keepCols <- veupathUtils::findNumericCols(data1)
if (length(keepCols) == 0) {
stop("No numeric columns found in data1.")
}
data1 <- data1[, ..keepCols]
}

Expand Down

0 comments on commit 35b6ab7

Please sign in to comment.