Skip to content

Instantly share code, notes, and snippets.

@rmflight
Created July 26, 2012 20:35
Show Gist options
  • Save rmflight/3184342 to your computer and use it in GitHub Desktop.
Save rmflight/3184342 to your computer and use it in GitHub Desktop.
Rmd programmatic links
@rmflight
Copy link
Author

Want to have R create a link programmatically so that those viewing the final report can simply click on it and be taken to the correct page? then this is what you need.

@yihui
Copy link

yihui commented Jul 27, 2012

You can make it more compact and readable:

```{r}
var1 <- "672"
var2 <- "12189"
```

[Results](http://www.ncbi.nlm.nih.gov/gene?term=`r I(c(var1, var2))`)

It is simple just because the coincidence that the knitr inline hook function uses paste(..., collapse = ', ') which happens to be valid for the URL for your case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment