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

(v0.7.1.9027) tibble printing

This commit is contained in:
2019-08-07 15:37:39 +02:00
parent 14c47da656
commit 90c874025a
42 changed files with 946 additions and 602 deletions

19
R/mic.R
View File

@ -173,9 +173,8 @@ as.mic <- function(x, na.rm = FALSE) {
list_missing, call. = FALSE)
}
x <- factor(x, levels = lvls, ordered = TRUE)
class(x) <- c('mic', 'ordered', 'factor')
x
structure(.Data = factor(x, levels = lvls, ordered = TRUE),
class = c('mic', 'ordered', 'factor'))
}
}
@ -279,3 +278,17 @@ barplot.mic <- function(height,
...)
axis(2, seq(0, max(table(droplevels.factor(height)))))
}
#' @importFrom pillar type_sum
#' @export
type_sum.mic <- function(x) {
"mic"
}
#' @importFrom pillar pillar_shaft
#' @export
pillar_shaft.mic <- function(x, ...) {
out <- trimws(format(x))
out[is.na(x)] <- NA
pillar::new_pillar_shaft_simple(out, align = "right", min_width = 4)
}