While debugging dplyr chains in a function, I often want to be able to print intermediate changes to a data.frame to the console. How would I do this?
For example:
data(cars)
cars %>% group_by(speed) %>%
summarize(dist_mean = mean(dist)) %>%
[insert printing function] %>%
group_by(speed > 10) %>%
summarize(dist_mean = mean(dist_mean)) %>%
[insert printing function]
Is there something I can do to replace [insert printing function] to print the current state of the dataframe to the console, while still continuing the chain uninterrupted?