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:
~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)~
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:
~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.~
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.
(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?
From #118
How to support printing whilst compiling using knitr? Multiverse supports two types of code chunks:
r
andmultiverse
. How should each of these behave whilst knitting?printing using an R code chunk
we have the following options:
r
by throwing an errorprinting using a multiverse code chunk:
we have the following options:
knit_as_emar()
function. Theknit_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 usingknit_as_emar()
, simply show the original multiverse code including branch functions but do not evaluate.