mirror of
https://github.com/msberends/AMR.git
synced 2025-07-08 16:42:10 +02:00
(v0.8.0.9003) printing fix for AB columns
This commit is contained in:
@ -118,7 +118,7 @@ get_column_abx <- function(x,
|
||||
verbose = FALSE,
|
||||
...) {
|
||||
|
||||
message(blue("NOTE: Auto-guessing columns suitable for analysis..."))
|
||||
message(blue("NOTE: Auto-guessing columns suitable for analysis..."), appendLF = FALSE)
|
||||
|
||||
x <- as.data.frame(x, stringsAsFactors = FALSE)
|
||||
x_bak <- x
|
||||
@ -169,6 +169,9 @@ get_column_abx <- function(x,
|
||||
duplicates <- x[base::duplicated(x)]
|
||||
x <- x[!names(x) %in% names(duplicates)]
|
||||
|
||||
# succeeded with aut-guessing
|
||||
message(blue("OK."))
|
||||
|
||||
if (verbose == TRUE) {
|
||||
for (i in seq_len(length(x))) {
|
||||
message(blue(paste0("NOTE: Using column `", bold(x[i]), "` as input for `", names(x)[i],
|
||||
|
7
R/rsi.R
7
R/rsi.R
@ -504,14 +504,13 @@ type_sum.rsi <- function(x) {
|
||||
}
|
||||
|
||||
#' @importFrom pillar pillar_shaft
|
||||
#' @importFrom crayon bgGreen bgYellow bgRed black make_style
|
||||
#' @importFrom crayon bgGreen bgYellow bgRed black white
|
||||
#' @export
|
||||
pillar_shaft.rsi <- function(x, ...) {
|
||||
out <- trimws(format(x))
|
||||
out[is.na(x)] <- pillar::style_subtle(" NA")
|
||||
real_white <- make_style(rgb(1, 1, 1))
|
||||
out[x == "S"] <- bgGreen(real_white(" S "))
|
||||
out[x == "S"] <- bgGreen(white(" S "))
|
||||
out[x == "I"] <- bgYellow(black(" I "))
|
||||
out[x == "R"] <- bgRed(real_white(" R "))
|
||||
out[x == "R"] <- bgRed(white(" R "))
|
||||
pillar::new_pillar_shaft_simple(out, align = "left", width = 3)
|
||||
}
|
||||
|
Reference in New Issue
Block a user