I am writing an R markdown document (from Shiny) where the user can decide on whether a pdf or html or word file shall be created. I am trying to include a composed link, like this:
```{r}
gene <- "ENSG00000139618"
urlEnsembleLink <- a("Ensemble", href=paste0("https://www.ensembl.org/Homo_sapiens/Gene/Summary?g=",gene), target="_blank")
'''
Ensemble URL link to gene: `r urlEnsembleLink`.
[Ensemble URL link to gene](https://www.ensembl.org/Homo_sapiens/Gene/Summary?g=ENSG00000139618){target="_blank"}.
The first part is within a code chunk, the second is in "pure" markdown document. Both versions work in a html document. In pdf, only the 2nd works, the first link is not displayed in the document. However, I need to make a composed link for pdf, where the last past of the link (here: "ENSG00000139618") is variable and set by e.g. "gene" variable in the chunk before. Any suggestions how to compose a link for pdf?