Chris
Chris

Reputation: 2071

Running external .rmd files from a .rmd file - R

I want to run an external .rmd file(AKA rstudio notebook file) when I run a specific .rmd file. For example, the project X has a.Rmd, b.Rmd, and c.Rmd files. However, to run c.Rmd I need to run a.Rmd and b.Rmd first. Currently, each time I run c.Rmd I have to run a.Rmd and b.Rmd manually beforehand. Is there a codeline like when I run c.Rmd, it will automatically run a.Rmd and b.Rmd?, for example:

Inside c.Rmd:

execute(a.Rmd)
execute(b.Rmd)

Upvotes: 1

Views: 687

Answers (1)

user2554330
user2554330

Reputation: 44788

I don't know the difference between an RStudio notebook file and any other R Markdown file, but this would work in the latter:

rmarkdown::render("a.Rmd")
rmarkdown::render("b.Rmd")

Upvotes: 1

Related Questions