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

Behavior of printing whilst compiling using knitr #121

Closed
abhsarma opened this issue Jul 17, 2024 · 1 comment
Closed

Behavior of printing whilst compiling using knitr #121

abhsarma opened this issue Jul 17, 2024 · 1 comment
Assignees
Labels

Comments

@abhsarma
Copy link
Collaborator

abhsarma commented Jul 17, 2024

From #118

How to support printing whilst compiling using knitr? Multiverse supports two types of code chunks: r and multiverse. How should each of these behave whilst knitting?

printing using an R code chunk

we have the following options:

  1. Print the last evaluation (i.e. the output from the last universe at that point in the code, which may not be the last universe in the overall universe)
  2. Do not allow a user to print variables declared from a multiverse code block using r by throwing an error

printing using a multiverse code chunk:

we have the following options:

  1. Print an output for each universe. This can get annoying if one is trying to print a data frame and ends up with hundreds of data frames.
  2. Do not print anything unless the user is compiling as an emar using the knit_as_emar() function. The knit_as_emar() function will incorporate the necessary tangle widgets which will allow the user to navigate the output of all the universes. If the user is not using knit_as_emar(), simply show the original multiverse code including branch functions but do not evaluate.
@mjskay
Copy link
Contributor

mjskay commented Jul 21, 2024

(2) seems reasonable to me when knitting. If you want a single value, either use a {multiverse} block or extract the variable from the specific universe you want and print that in an {r} block... right?

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

No branches or pull requests

2 participants