i know can done php , other languages, wondering whether following accomplished using knitr:
let's have rmarkdown (.rmd) document 2 heading 1 sections:
# first heading first document lorem ipsum dolor sit amet # second heading first document plot(object)
question 1: if open .rmd document, how can create link when parsed document present content whole content first document. example:
# first heading second document lorem ipsum dolor sit amet [command goes here insert first document]
result be:
# first heading second document lorem ipsum dolor sit amet # first heading first document lorem ipsum dolor sit amet # second heading first document [plot shows here]
question 2: knitr allow me select , insert selected portions of document 1 document 2? example, heading 1 , content below it, or heading 2 , plot
that chunk option
child
for, e.g. insecond.rmd
, can```{r child='first.rmd'} ```
that little bit trickier, can call
knit_child()
manually, e.g.```{r echo=false, results='asis'} # knit first 3 lines of first.rmd cat(knit_child(text = readlines('first.rmd')[1:3]), sep = '\n') ```
Comments
Post a Comment