boomer
boomer copied to clipboard
Explore intermediate steps using View or a webpage ?
Using View is a hack but would still be helpful,
We'd call boom(subset(head(mtcars, 1 + 1), qsec > 17), view = TRUE)
and have this happen, simulated here by :
boomed <- list("subset(head(mtcars, 1 + 1), qsec > 17)" = list(
" " = subset(head(mtcars, 1 + 1), qsec > 17),
"head(mtcars, 1 + 1)" = list(
" " = head(mtcars, 1 + 1),
"1 + 1" = 1 + 1
),
"qsec > 17" = c(FALSE, TRUE)
))
nm <- names(boomed)
assign(nm, boomed[[1]])
eval(substitute(View(OBJ), list(OBJ = as.symbol(nm))))
This is a bit akward, but technically we can have a nice webpage or shiny app that would do the same.
Instead (or on top) of printing, we'd store results in a nested list, and offer a nice interface to explore it.
I can imagine something with tabs as in {covr}, so if we rig_in_namespace
several functions each call would get a tab, so we'd explore nesting by expanding the tree, and recursive rigged functions by clicking on calls that would open the relevant tab, intermediate results would be easy to print or fetch.
see also https://github.com/moodymudskipper/boomer/issues/32
Nested <details>
maybe, with the first level open by default? Indent seems to be lost, but we could tweak with an extra <div>
?