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

(v1.8.0.9005) as.rsi() fix

This commit is contained in:
2022-03-10 19:33:25 +01:00
parent ad82bb4ce0
commit 08d387b5ce
102 changed files with 1564 additions and 877 deletions

12
R/mic.R
View File

@ -243,14 +243,12 @@ droplevels.mic <- function(x, exclude = if (any(is.na(levels(x)))) NULL else NA,
pillar_shaft.mic <- function(x, ...) {
crude_numbers <- as.double(x)
operators <- gsub("[^<=>]+", "", as.character(x))
pasted <- trimws(paste0(operators, trimws(format(crude_numbers))))
out <- pasted
operators[operators != ""] <- font_silver(operators[operators != ""], collapse = NULL)
out <- trimws(paste0(operators, trimws(format(crude_numbers))))
out[is.na(x)] <- font_na(NA)
out <- gsub("(<|=|>)", font_silver("\\1"), out)
if (any(out %like% "[.]", na.rm = TRUE)) {
out <- gsub("([.]?0+)$", font_white("\\1"), out)
}
create_pillar_column(out, align = "right", width = max(nchar(pasted)))
# maketrailing zeroes almost invisible
out[out %like% "[.]"] <- gsub("([.]?0+)$", font_white("\\1"), out[out %like% "[.]"], perl = TRUE)
create_pillar_column(out, align = "right", width = max(nchar(font_stripstyle(out))))
}
# will be exported using s3_register() in R/zzz.R