1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-09 10:21:49 +02:00

(v1.4.0.9001) is_gram_positive(), is_gram_negative(), parameter hardening

This commit is contained in:
2020-10-19 17:09:19 +02:00
parent 833a1be36d
commit 4e9ccb4435
76 changed files with 969 additions and 491 deletions

View File

@ -58,6 +58,9 @@
#' as.rsi(df)
#' }
as.disk <- function(x, na.rm = FALSE) {
meet_criteria(x, allow_class = c("disk", "character", "numeric", "integer"), allow_NA = TRUE)
meet_criteria(na.rm, allow_class = "logical", has_length = 1)
if (!is.disk(x)) {
x <- x %pm>% unlist()
if (na.rm == TRUE) {
@ -109,6 +112,9 @@ as.disk <- function(x, na.rm = FALSE) {
}
all_valid_disks <- function(x) {
if (!inherits(x, c("disk", "character", "numeric", "integer"))) {
return(FALSE)
}
x_disk <- suppressWarnings(as.disk(x[!is.na(x)]))
!any(is.na(x_disk)) & !all(is.na(x))
}