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:
19
R/mic.R
19
R/mic.R
@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user