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

(v1.3.0.9008) also tibble printing for ab

This commit is contained in:
2020-08-26 15:34:12 +02:00
parent 5e45fdcf2a
commit 9b8db57c65
44 changed files with 63 additions and 52 deletions

20
R/ab.R
View File

@ -467,6 +467,26 @@ is.ab <- function(x) {
inherits(x, "ab")
}
#' @method pillar_shaft ab
#' @export
pillar_shaft.ab <- function(x, ...) {
# import from the pillar package, without being dependent on it!
style_na <- import_fn("style_na", "pillar", error_on_fail = FALSE)
new_pillar_shaft_simple <- import_fn("new_pillar_shaft_simple", "pillar", error_on_fail = FALSE)
out <- format(x)
out[is.na(x)] <- style_na(NA)
new_pillar_shaft_simple(out,
align = "left",
min_width = 4)
}
#' @method type_sum ab
#' @export
type_sum.ab <- function(x, ...) {
"ab"
}
#' @method print ab
#' @export
#' @noRd