Inline vs. Chunk Execution of R
Code: How to check from within a function?
#6542
Replies: 4 comments 1 reply
-
This is not up to Quarto (or rmarkdown for that matter). |
Beta Was this translation helpful? Give feedback.
-
Thank you, @mcanouil for sending me down the right path. Exploring the output of knitr::knit_hooks$set(
chunk = function(x, options) {
x %<>% stringi::stri_replace_first_regex(
"^\\[\\d+\\]\\s*\"(.*)\"\\s*$", "$1")
paste(as.character(x), collapse = ", ")
})
on.exit(knitr::knit_hooks$restore()) This appears to do what I want. |
Beta Was this translation helpful? Give feedback.
-
@r-cheologist Have you tried using |
Beta Was this translation helpful? Give feedback.
-
Adding that See more at https://cran.r-project.org/web/packages/knitr/vignettes/knit_print.html |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Output of an
R
function that is to be used in both inline and chunk code execution needs (in the context ofoutput: asis
as a chunk execution option) to usecat()
only in the latter case.It would thus be convenient to be able to achieve what the following pdeudo-code demonstrates:
Is there functionality available that provides access to the
IS_EXECUTED_INLINE
bit of information?Beta Was this translation helpful? Give feedback.
All reactions