library(tibble)
tibble:::set_fansi_hooks()
x <- tibble(a = tibble(x = 1, y = 2), b = "long enough")
# Side effect: queries color information internally in pillar
x
## # A tibble: 1 × 2
## a$x $y b
## <dbl> <dbl> <chr>
## 1 1 2 long enough
pillar::tbl_format_setup(x, width = 20)
## <pillar_tbl_format_setup>
## <tbl_format_header(setup)>
## # A tibble: 1 × 2
## <tbl_format_body(setup)>
## a$x $y b
## <dbl> <dbl> <chr>
## 1 1 2 long …
## <tbl_format_footer(setup)>
pillar::tbl_format_setup(x, width = 20, focus = "b")
## <pillar_tbl_format_setup>
## <tbl_format_header(setup)>
## # A tibble: 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>
pillar::tbl_format_setup(x[2:1], width = 20, focus = "a")
## <pillar_tbl_format_setup>
## <tbl_format_header(setup)>
## # A tibble: 1 × 2
## <tbl_format_body(setup)>
## b a$x $y
## <chr> <dbl> <dbl>
## 1 long … 1 2
## <tbl_format_footer(setup)>