Linking to url with rmarkdown using Knit Word in Rstudio
-
21-12-2019 - |
Question
Is there an easy way to link to a webpage in rmarkdown
without displaying the link?
For example, putting "https://www.google.com/" in a .rmd
file renders as the entire website, but I want something analogous to <a href="https://www.google.com/">ABC</a>
instead.
The html method above, i.e., <a href= ...
works when I knit to html, but it does not work when I knit to a word document.
Solution
Markdown provides two ways to create a link as you mention (and I suppose that is supported on rmarkdown).
- Markdown way:
[ABC](http://example.com)
- HTML way:
<a href="http://example.com">ABC</a>
The first way is native and the second way is supported since Markdown allows every HTML code.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow