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:
6
R/disk.R
6
R/disk.R
@ -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))
|
||||
}
|
||||
|
Reference in New Issue
Block a user