Printing a tibble: Tracking control flow

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

What happens when a tibble is printed? This vignette shows the actual control flow, powered by the debugme package. See vignette("printing") for a detailed description of the control and data flows.

To activate debugging, we need to set an environment variable before loading the pillar package. As a result, debug strings in pillar's code are replaced with calls to a logging function.

By default, debugme also shows timestamps. This is disabled to keep the output stable.

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)
writeLines(readLines("debugme.txt"))


Try the pillar package in your browser

Any scripts or data that you put into this service are public.

pillar documentation built on March 31, 2023, 10:19 p.m.