Note: I think rvest and dependencies can handle this better.
# install.packages("devtools")
devtools::install_github(repo = "davidmasp/Requires")
In order to extract dependencies from a script
Requires::make_require(file = "R/funs.R")
This will generate a set of files containing the dependencies of the packages.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.