Printing a tibble: Tracking control flow

Tibbleを表示するとどうなるのか? この vignette は、 debugme package を電源とする、実際の制御フローを示したものである。 制御とデータの流れの詳細については、vignette("printing") を参照。

デバッグを有効にするには、pillar パッケージをロードする前に環境変数を設定する必要がある。 その結果、pillarのコード内のデバッグ文字列は、ロギング関数への呼び出しに置き換えられる。

デフォルトでは、debugmeはタイムスタンプも表示す。 出力を安定させるために無効にしている。

Sys.setenv(DEBUGME = "!!!!pillar")
Sys.setenv(DEBUGME_SHOW_TIMESTAMP = "no")

library(pillar)

tbl <- tibble::tibble(a = 1:3, b = tibble::tibble(c = 4:6, d = 7:9), e = 10:12)
print(tbl, width = 23)
#> #> pillar tbl_format_setup()
#> #> pillar +-tbl_format_setup.tbl()
#> #> pillar   +-ctl_colonnade()
#> #> pillar     +-ctl_new_compound_pillar(width = 21, title = "a")
#> #> pillar       +-ctl_new_compound_pillar.tbl(width = 21, title = "a")
#> #> pillar         +-ctl_new_pillar(width = 21, title = "a")
#> #> pillar           +-ctl_new_pillar.tbl(width = 21, title = "a")
#> #> pillar             +-pillar(title = "a", width = 21)
#> #> pillar               +-new_pillar_title(x = "a")
#> #> pillar               +-new_pillar_type(class(x) = "integer")
#> #> pillar               +-pillar_shaft(class(x) = "integer")
#> #> pillar               +-new_pillar_component(x = <list: <pllr_sh_>>, width = 1L, min_width = 1L)
#> #> pillar               +-new_pillar(width = 21, class = NULL)
#> #> pillar                 +-new_pillar_component(x = <list: <pllr_ttl>>, width = 1L, min_width = 1L)
#> #> pillar                 +-new_pillar_component(x = <list: <pllr_typ>>, width = 5L, min_width = 5L)
#> #> pillar     +-ctl_new_compound_pillar(width = 15, title = "b")
#> #> pillar       +-ctl_new_compound_pillar.tbl(width = 15, title = "b")
#> #> pillar         +-ctl_new_compound_pillar(width = 15, title = <chr: "b$", "c">)
#> #> pillar           +-ctl_new_compound_pillar.tbl(width = 15, title = <chr: "b$", "c">)
#> #> pillar             +-ctl_new_pillar(width = 15, title = "b$c")
#> #> pillar               +-ctl_new_pillar.tbl(width = 15, title = "b$c")
#> #> pillar                 +-pillar(title = "b$c", width = 15)
#> #> pillar                   +-new_pillar_title(x = "b$c")
#> #> pillar                   +-new_pillar_type(class(x) = "integer")
#> #> pillar                   +-pillar_shaft(class(x) = "integer")
#> #> pillar                   +-new_pillar_component(x = <list: <pllr_sh_>>, width = 1L, min_width = 1L)
#> #> pillar                   +-new_pillar(width = 15, class = NULL)
#> #> pillar                     +-new_pillar_component(x = <list: <pllr_ttl>>, width = 3L, min_width = 3L)
#> #> pillar                     +-new_pillar_component(x = <list: <pllr_typ>>, width = 5L, min_width = 5L)
#> #> pillar         +-ctl_new_compound_pillar(width = 9, title = <chr: "$", "d">)
#> #> pillar           +-ctl_new_compound_pillar.tbl(width = 9, title = <chr: "$", "d">)
#> #> pillar             +-ctl_new_pillar(width = 9, title = "$d")
#> #> pillar               +-ctl_new_pillar.tbl(width = 9, title = "$d")
#> #> pillar                 +-pillar(title = "$d", width = 9)
#> #> pillar                   +-new_pillar_title(x = "$d")
#> #> pillar                   +-new_pillar_type(class(x) = "integer")
#> #> pillar                   +-pillar_shaft(class(x) = "integer")
#> #> pillar                   +-new_pillar_component(x = <list: <pllr_sh_>>, width = 1L, min_width = 1L)
#> #> pillar                   +-new_pillar(width = 9, class = NULL)
#> #> pillar                     +-new_pillar_component(x = <list: <pllr_ttl>>, width = 2L, min_width = 2L)
#> #> pillar                     +-new_pillar_component(x = <list: <pllr_typ>>, width = 5L, min_width = 5L)
#> #> pillar         +-new_pillar_component(x = <list: <pllr_ttl>, <pllr_ttl>>, width = <int: 3L, 2L>, min_width = <int: 3L, 2L>)
#> #> pillar         +-new_pillar_component(x = <list: <pllr_typ>, <pllr_typ>>, width = <int: 5L, 5L>, min_width = <int: 5L, 5L>)
#> #> pillar         +-new_pillar_component(x = <list: <pllr_sh_>, <pllr_sh_>>, width = <int: 1L, 1L>, min_width = <int: 1L, 1L>)
#> #> pillar         +-new_pillar(width = NULL, class = "compound_pillar")
#> #> pillar     +-ctl_new_compound_pillar(width = 3, title = "e")
#> #> pillar       +-ctl_new_compound_pillar.tbl(width = 3, title = "e")
#> #> pillar         +-ctl_new_pillar(width = 3, title = "e")
#> #> pillar           +-ctl_new_pillar.tbl(width = 3, title = "e")
#> #> pillar             +-pillar(title = "e", width = 3)
#> #> pillar               +-new_pillar_title(x = "e")
#> #> pillar               +-new_pillar_type(class(x) = "integer")
#> #> pillar     +-new_pillar_component(x = <list: <pllr_ttl>, <pllr_ttl>, <pllr_ttl>>, width = <int: 1L, 3L, 2L>, min_width = <int: 1L, 3L, 2L>)
#> #> pillar     +-new_pillar_component(x = <list: <pllr_typ>, <pllr_typ>, <pllr_typ>>, width = <int: 5L, 5L, 5L>, min_width = <int: 5L, 5L, 5L>)
#> #> pillar     +-new_pillar_component(x = <list: <pllr_sh_>, <pllr_sh_>, <pllr_sh_>>, width = <int: 1L, 1L, 1L>, min_width = <int: 1L, 1L, 1L>)
#> #> pillar     +-new_pillar(width = NULL, class = "compound_pillar")
#> #> pillar     +-new_pillar(width = NULL, class = NULL)
#> #> pillar       +-new_pillar_component(x = <list: <pllr_ttl>>, width = 1L, min_width = 1L)
#> #> pillar       +-new_pillar_component(x = <list: <pllr_typ>>, width = 5L, min_width = 5L)
#> #> pillar       +-new_pillar_component(x = <list: <pllr_sh_>>, width = 1L, min_width = 1L)
#> #> pillar     +-new_pillar(width = NULL, class = NULL)
#> #> pillar       +-new_pillar_component(x = <list: <pllr_ttl>>, width = 3L, min_width = 3L)
#> #> pillar       +-new_pillar_component(x = <list: <pllr_typ>>, width = 5L, min_width = 5L)
#> #> pillar       +-new_pillar_component(x = <list: <pllr_sh_>>, width = 1L, min_width = 1L)
#> #> pillar     +-new_pillar(width = NULL, class = NULL)
#> #> pillar       +-new_pillar_component(x = <list: <pllr_ttl>>, width = 2L, min_width = 2L)
#> #> pillar       +-new_pillar_component(x = <list: <pllr_typ>>, width = 5L, min_width = 5L)
#> #> pillar       +-new_pillar_component(x = <list: <pllr_sh_>>, width = 1L, min_width = 1L)
#> #> pillar     +-new_pillar_component(x = <list: <pllr_rf_>>, width = 1L, min_width = 1L)
#> #> pillar     +-new_pillar_component(x = <list: <pllr_rf_>>, width = 1L, min_width = 1L)
#> #> pillar     +-new_pillar(width = NULL, class = NULL)
#> #> # A tibble: 3 x 3
#> #>       a   b$c    $d
#> #>   <int> <int> <int>
#> #> 1     1     4     7
#> #> 2     2     5     8
#> #> 3     3     6     9
#> #> # … with 1 more
#> #> #   variable: e <int>