pluke
pluke

Reputation: 4356

rmarkdown running child chunks from inside RStudio

I've been moving some of the code for a report I'm writing to child .rmd files. I want to run these chunks by clicking on the green arrow (top right):

enter image description here

But this doesn't work in RStudio, is this a feature or a bug?

Upvotes: 8

Views: 1104

Answers (1)

Jonathan
Jonathan

Reputation: 8832

This has not been implemented in RStudio yet, and probably won't be for some time.

However, you can write your R code in a separate file, reference it in R Markdown chunks, and execute those chunks interactively in RStudio. The way to do this is with knitr's code externalization feature. You can read about how to use it in R Markdown notebooks here:

https://rmarkdown.rstudio.com/r_notebooks.html#executing_code (scroll down a bit to Executing External Chunks)

More on code externalization with knitr here:

https://yihui.name/knitr/demo/externalization/

Upvotes: 3

Related Questions