# color Code style_na("NA") Output [1] "\033[31mNA\033[39m" Code style_neg("-1") Output [1] "\033[31m-1\033[39m" --- Code xf <- (function() ctl_colonnade(list(x = c((10^(-3:4)) * c(-1, 1), NA)))) print(xf()) Output $body x <dbl> 1 -0.001 2 0.01 3 -0.1 4 1 5 -10 6 100 7 -1000 8 10000 9 NA $extra_cols list() $abbrev_cols character(0) $abbrev_col_idxs numeric(0) Code with_options(pillar.subtle_num = TRUE, print(xf())) Output $body x <dbl> 1 -0.001 2 0.01 3 -0.1 4 1 5 -10 6 100 7 -1000 8 10000 9 NA $extra_cols list() $abbrev_cols character(0) $abbrev_col_idxs numeric(0) Code with_options(pillar.subtle = FALSE, print(xf())) Output $body x <dbl> 1 -0.001 2 0.01 3 -0.1 4 1 5 -10 6 100 7 -1000 8 10000 9 NA $extra_cols list() $abbrev_cols character(0) $abbrev_col_idxs numeric(0) Code with_options(pillar.neg = FALSE, print(xf())) Output $body x <dbl> 1 -0.001 2 0.01 3 -0.1 4 1 5 -10 6 100 7 -1000 8 10000 9 NA $extra_cols list() $abbrev_cols character(0) $abbrev_col_idxs numeric(0) Code with_options(pillar.subtle = FALSE, pillar.neg = FALSE, print(xf())) Output $body x <dbl> 1 -0.001 2 0.01 3 -0.1 4 1 5 -10 6 100 7 -1000 8 10000 9 NA $extra_cols list() $abbrev_cols character(0) $abbrev_col_idxs numeric(0) Code with_options(pillar.bold = TRUE, print(xf())) Output $body x <dbl> 1 -0.001 2 0.01 3 -0.1 4 1 5 -10 6 100 7 -1000 8 10000 9 NA $extra_cols list() $abbrev_cols character(0) $abbrev_col_idxs numeric(0) --- Code ctl_colonnade(list(a_very_long_column_name = 0), width = 20) Output $body a_very_long_colu…¹ <dbl> 1 0 $extra_cols list() $abbrev_cols [1] "a_very_long_column_name" $abbrev_col_idxs numeric(0) # focus columns Code tbl_format_setup(x, width = 30, focus = "b") Output <pillar_tbl_format_setup> <tbl_format_header(setup)> # A data frame: 1 × 2 <tbl_format_body(setup)> a$x $y b <dbl> <dbl> <chr> 1 1 2 long enough <tbl_format_footer(setup)> Code tbl_format_setup(x, width = 20, focus = "b") Output <pillar_tbl_format_setup> <tbl_format_header(setup)> # A data frame: 1 × # 2 <tbl_format_body(setup)> a$x b <dbl> <chr> 1 1 long enough <tbl_format_footer(setup)> # … with 1 more # variable: # a$y <dbl> Code tbl_format_setup(x, width = 15, focus = "b") Output <pillar_tbl_format_setup> <tbl_format_header(setup)> # A data # frame: 1 × # 2 <tbl_format_body(setup)> b <chr> 1 long enough <tbl_format_footer(setup)> # … with 1 # more # variable: # a <tbl[,2]> Code tbl_format_setup(x, width = 10, focus = "b") Output <pillar_tbl_format_setup> <tbl_format_header(setup)> # A data # frame: # 1 × 2 <tbl_format_body(setup)> b <chr> 1 long en… <tbl_format_footer(setup)> # … with # 1 # more # variable: # a <tbl[,2]> Code tbl_format_setup(x[2:1], width = 30, focus = "a") Output <pillar_tbl_format_setup> <tbl_format_header(setup)> # A data frame: 1 × 2 <tbl_format_body(setup)> b a$x $y <chr> <dbl> <dbl> 1 long enough 1 2 <tbl_format_footer(setup)> Code tbl_format_setup(x[2:1], width = 20, focus = "a") Output <pillar_tbl_format_setup> <tbl_format_header(setup)> # A data frame: 1 × # 2 <tbl_format_body(setup)> b a$x $y <chr> <dbl> <dbl> 1 long … 1 2 <tbl_format_footer(setup)> Code tbl_format_setup(x[2:1], width = 15, focus = "a") Output <pillar_tbl_format_setup> <tbl_format_header(setup)> # A data # frame: 1 × # 2 <tbl_format_body(setup)> a$x $y <dbl> <dbl> 1 1 2 <tbl_format_footer(setup)> # … with 1 # more # variable: # b <chr> Code tbl_format_setup(x[2:1], width = 10, focus = "a") Output <pillar_tbl_format_setup> <tbl_format_header(setup)> # A data # frame: # 1 × 2 <tbl_format_body(setup)> a$x <dbl> 1 1 <tbl_format_footer(setup)> # … with # 2 # more # variables: # a$y <dbl>, # b <chr> Code tbl_format_setup(x, width = 30, focus = c("a", "b")) Output <pillar_tbl_format_setup> <tbl_format_header(setup)> # A data frame: 1 × 2 <tbl_format_body(setup)> a$x $y b <dbl> <dbl> <chr> 1 1 2 long enough <tbl_format_footer(setup)> Code tbl_format_setup(x, width = 20, focus = c("a", "b")) Output <pillar_tbl_format_setup> <tbl_format_header(setup)> # A data frame: 1 × # 2 <tbl_format_body(setup)> a$x $y b <dbl> <dbl> <chr> 1 1 2 long … <tbl_format_footer(setup)> Code tbl_format_setup(x, width = 15, focus = c("a", "b")) Output <pillar_tbl_format_setup> <tbl_format_header(setup)> # A data # frame: 1 × # 2 <tbl_format_body(setup)> a$x b <dbl> <chr> 1 1 long e… <tbl_format_footer(setup)> # … with 1 # more # variable: # a$y <dbl> Code tbl_format_setup(x, width = 10, focus = c("a", "b")) Output <pillar_tbl_format_setup> <tbl_format_header(setup)> # A data # frame: # 1 × 2 <tbl_format_body(setup)> a$x <dbl> 1 1 <tbl_format_footer(setup)> # … with # 2 # more # variables: # a$y <dbl>, # b <chr> Code tbl_format_setup(x[2:1], width = 30, focus = c("a", "b")) Output <pillar_tbl_format_setup> <tbl_format_header(setup)> # A data frame: 1 × 2 <tbl_format_body(setup)> b a$x $y <chr> <dbl> <dbl> 1 long enough 1 2 <tbl_format_footer(setup)> Code tbl_format_setup(x[2:1], width = 20, focus = c("a", "b")) Output <pillar_tbl_format_setup> <tbl_format_header(setup)> # A data frame: 1 × # 2 <tbl_format_body(setup)> b a$x <chr> <dbl> 1 long enough 1 <tbl_format_footer(setup)> # … with 1 more # variable: # a$y <dbl> Code tbl_format_setup(x[2:1], width = 15, focus = c("a", "b")) Output <pillar_tbl_format_setup> <tbl_format_header(setup)> # A data # frame: 1 × # 2 <tbl_format_body(setup)> b a$x <chr> <dbl> 1 long e… 1 <tbl_format_footer(setup)> # … with 1 # more # variable: # a$y <dbl> Code tbl_format_setup(x[2:1], width = 10, focus = c("a", "b")) Output <pillar_tbl_format_setup> <tbl_format_header(setup)> # A data # frame: # 1 × 2 <tbl_format_body(setup)> b <chr> 1 long en… <tbl_format_footer(setup)> # … with # 1 # more # variable: # a <tbl[,2]>
Generated by dwww version 1.15 on Sat May 18 08:40:58 CEST 2024.