I know this can be done with php and other languages, but was wondering whether the following could be accomplished using knitr:
Let's say I have an Rmarkdown (.rmd) document with two heading 1 sections:
# This is the first heading for the first document
Lorem ipsum dolor sit amet
# This is the second heading for the first document
plot(object)
Question 1: if open another .rmd document, how can i create a link so that when parsed this document would present its content as well as the whole content from the first document. For example:
# This is the first heading for the second document Lorem ipsum dolor sit amet [command goes here to insert the first document]
result would be:
# This is the first heading for the second document Lorem ipsum dolor sit amet # This is the first heading for the first document Lorem ipsum dolor sit amet # This is the second heading for the first document [plot shows up here]
Question 2: would knitr allow me to select and insert only selected portions of document 1 into document 2? For example, only heading 1 and the content below it, or only heading 2 and its plot