1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-08 11:51:59 +02:00

(v1.2.0.9008) ab_class improvement

This commit is contained in:
2020-06-17 15:14:37 +02:00
parent c4d7412f36
commit ac12392da3
37 changed files with 619 additions and 362 deletions

6
R/mo.R
View File

@ -152,7 +152,7 @@
#' \dontrun{
#' df$mo <- as.mo(df$microorganism_name)
#'
#' # the select function of tidyverse is also supported:
#' # the select function of the Tidyverse is also supported:
#' library(dplyr)
#' df$mo <- df %>%
#' select(microorganism_name) %>%
@ -1805,13 +1805,13 @@ parse_and_convert <- function(x) {
if (NCOL(x) > 2) {
stop("A maximum of two columns is allowed.", call. = FALSE)
} else if (NCOL(x) == 2) {
# support tidyverse selection like: df %>% select(colA, colB)
# support Tidyverse selection like: df %>% select(colA, colB)
# paste these columns together
x <- as.data.frame(x, stringsAsFactors = FALSE)
colnames(x) <- c("A", "B")
x <- paste(x$A, x$B)
} else {
# support tidyverse selection like: df %>% select(colA)
# support Tidyverse selection like: df %>% select(colA)
x <- as.data.frame(x, stringsAsFactors = FALSE)[[1]]
}
}