[R] RMarkdown question

Yihui Xie xie at yihui.name
Tue Aug 29 23:52:09 CEST 2017


Although it is not an elegant solution, but if your output format is
HTML, you can add an arbitrary empty HTML element like <span
id="foo"></span> before your code chunk. Then you can jump to this
<span> via a link like "see [this code chunk](#foo)".

Regards,
Yihui
--
https://yihui.name


On Tue, Aug 29, 2017 at 1:30 PM, Roy Mendelssohn - NOAA Federal
<roy.mendelssohn at noaa.gov> wrote:
> Hi All:
>
> In creating a R Notebook I know that in the text I can  link to a (sub) section by using the command:
>
>
> [Header 1](#anchor)
>
>
>  and putting the appropriate anchor name at the appropriate header.  But can the same be done for code chunks,  if the code chunk is named? What I want to do is say that such and such code chunk is an example of how to do something,  and have that link to the appropriate code chunk.
>
> Thanks for any help.
>
> -Roy
>
>
>
>
>
> **********************
> "The contents of this message do not reflect any position of the U.S. Government or NOAA."
> **********************
> Roy Mendelssohn
> Supervisory Operations Research Analyst
> NOAA/NMFS
> Environmental Research Division
> Southwest Fisheries Science Center
> ***Note new street address***
> 110 McAllister Way
> Santa Cruz, CA 95060
> Phone: (831)-420-3666
> Fax: (831) 420-3980
> e-mail: Roy.Mendelssohn at noaa.gov www: http://www.pfeg.noaa.gov/
>
> "Old age and treachery will overcome youth and skill."
> "From those who have been given much, much will be expected"
> "the arc of the moral universe is long, but it bends toward justice" -MLK Jr.
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list