library(dplyr)
# 1. Create a chronicle object with a multi-step log
r_select <- record(select)
r_filter <- record(filter)
original_chronicle <- starwars %>%
r_select(name, height, mass, species) %>%
bind_record(r_filter, species == "Human")
# 2. View the original, detailed log
cat("--- Original Log ---\n")
read_log(original_chronicle)
# 3. Zap the log
zapped_chronicle <- zap_log(original_chronicle)
# 4. View the new, simplified log
cat("\n--- Zapped Log ---\n")
read_log(zapped_chronicle)
# 5. The underlying data value is unaffected
identical(
unveil(original_chronicle, "value"),
unveil(zapped_chronicle, "value")
)
Run the code above in your browser using DataLab