I am working with markdonw v2, the rmarkdown
package. Throughout the .Rmd file, I create links to websites or images
[Link1][pathLink1]
![Image1][pathImage1]
then, at the end of the document I give the references
[pathLink1]:http://website.com/linkes/Link1.md
![pathImage1]:./images_rmd/
There are other reports that talk about the same citation and use same images in different contexts. I would like to create a separate file containing all the links and path difinitions, so that I could simply source it at the end of each .Rmd file, like I would call in an R environment
source(/Rcode1.R)
Question: How do I "source" another file in .Rmd, so that the sourced code prints needed text strings into the .Rmd file?
This would offer some help with citations and scientific paper composition in HTML and PDF.
http://yihui.name/knitr/demo/child/
```{r child, child = '~/path/to/child.Rmd'}
```
and similarly for .Rnw files:
<<child, child = '~/path/to/child.Rnw'>>=
@
And a full example: https://github.com/yihui/knitr-examples/blob/master/087-child-example.Rnw
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With