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

(v1.4.0.9016) as.rsi() older R versions

This commit is contained in:
2020-11-10 19:59:14 +01:00
parent 15c732703d
commit 68ac39aa7f
14 changed files with 28 additions and 17 deletions

View File

@ -313,7 +313,9 @@ word_wrap <- function(...,
}
msg <- gsub("\n", paste0("\n", strrep(" ", indentation)), msg, fixed = TRUE)
msg <- gsub("*|*", paste0("*|*", strrep(" ", indentation)), msg, fixed = TRUE)
# remove trailing empty characters
msg <- gsub("(\n| )+$", "", msg)
if (length(add_fn) > 0) {
if (!is.list(add_fn)) {
add_fn <- list(add_fn)

View File

@ -469,6 +469,13 @@ as.rsi.data.frame <- function(x,
meet_criteria(conserve_capped_values, allow_class = "logical", has_length = 1)
meet_criteria(add_intrinsic_resistance, allow_class = "logical", has_length = 1)
for (i in seq_len(ncol(x))) {
# don't keep factors
if (is.factor(x[, i, drop = TRUE])) {
x[, i] <- as.character(x[, i, drop = TRUE])
}
}
# -- MO
col_mo.bak <- col_mo
if (is.null(col_mo)) {