Hyperlink in R document
Asked Answered
O

1

26

I am writing an R document (Rd) for functions. In markdown, we can create a hyperlink by [google](https://www.google.com). How can I replicate this in R document?

It seems that \link{...} can only create a link, which is different from what I am looking for.

Occupant answered 3/6, 2015 at 4:18 Comment(0)
C
42

The link{} macro is to link to other documentation pages.

You can use the \href{}{} macro to include a link to another webpage, where the text displayed is not the link.

Example:

\href{http://stackoverflow.com/}{Stack Overflow}

In addition to the official R documentation for package development, you can also read the "Object Documentation" section of Hadley's "R Packages" book.

Clearcut answered 3/6, 2015 at 5:7 Comment(1)
I would add that for CRAN submission, all links have to work, so the \samp{} notation can be used for links that are not real or that may involve, e.g., login screen redirects.Dilatation

© 2022 - 2024 — McMap. All rights reserved.