reference knitr chunk in R markdown -


i'm using knitr embed r code within markdown (.rmd) file. i'm converting file pdf file pandoc. contents of .rmd file looks this:

report ========================================================  report. analysis included in link chunk named my.analysis here   ```{r my.analysis, echo=false}  summary(cars)  ``` 

where says link chunk named my.analysis here, able provide link code chunk named my.analysis in outputted pdf?

i believe op asked similar, different question here: figure captions, references using knitr , markdown html

do this:

report ========================================================  report. analysis included in \href{http://stackoverflow.com/q/16445247/1000343}{link chunk named my.analysis here}   ```{r my.analysis, echo=false}  summary(cars)  ``` 

and covert markdown file (not rmd) pdf.

this works using devel version of reports:

```{r setup, include=false} # set global chunk options opts_chunk$set(cache=true) library(reports); library(knitr);  ``` report ========================================================  report. analysis included in `r hr("http://stackoverflow.com/q/16445247/1000343", "link chunk named my.analysis here")`   ```{r my.analysis, echo=false}  summary(cars)  ``` 

you convert html file pdf.


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -