Closed kylebutts closed 7 months ago
Hi,
The R VSCode extension has nice support for inline code chunks for R scripts using the # %% comment to separate code chunks. This small change would integrate with this and allow a seamless .R notebook script to report pipeline
# %%
.R
This will also help with https://github.com/quarto-dev/quarto-cli/issues/6660 allowing to render .R scripts with quarto https://quarto.org/docs/prerelease/1.4/script.html
Running knitr::spin("test.R", format = ".qmd) on this
knitr::spin("test.R", format = ".qmd)
#'--- #'title: "test" #'--- # %% setup #| message = FALSE, #| warning = FALSE library(tidyverse) v = seq(-pi, pi, 0.01) data = data.frame( x = v, y = sin(v) ) # %% ggplot() + geom_point( aes(x = x, y = y), data = data )
produces a valid qmd document:
--- title: "test" --- ```{r setup} #| message = FALSE, #| warning = FALSE library(tidyverse) v = seq(-pi, pi, 0.01) data = data.frame( x = v, y = sin(v) )
ggplot() + geom_point( aes(x = x, y = y), data = data )
All committers have signed the CLA.
Hi,
The R VSCode extension has nice support for inline code chunks for R scripts using the
# %%
comment to separate code chunks. This small change would integrate with this and allow a seamless.R
notebook script to report pipelineThis will also help with https://github.com/quarto-dev/quarto-cli/issues/6660 allowing to render
.R
scripts with quarto https://quarto.org/docs/prerelease/1.4/script.htmlRunning
knitr::spin("test.R", format = ".qmd)
on thisproduces a valid qmd document: