Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explore intermediate steps using View or a webpage ? #32

Open
moodymudskipper opened this issue Jun 7, 2021 · 2 comments
Open

Explore intermediate steps using View or a webpage ? #32

moodymudskipper opened this issue Jun 7, 2021 · 2 comments

Comments

@moodymudskipper
Copy link
Owner

moodymudskipper commented Jun 7, 2021

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))))

boomer_view

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.

@moodymudskipper
Copy link
Owner Author

see also #32

@krlmlr
Copy link
Collaborator

krlmlr commented Jun 11, 2021

Nested <details> maybe, with the first level open by default? Indent seems to be lost, but we could tweak with an extra <div> ?

Expression 1
Expression 2
Expression 3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants