# Install all required packages for this example
required_packages <- c("devtools",
"testthat",
"dplyr",
"plyr",
"elevatr",
"magrittr",
"units",
"sp",
"sf",
"rgdal")
installed_packages <- installed.packages()[,1]
to_install <- setdiff(required_packages, installed_packages)
if (length(to_install) > 0) {
print("Installing required packages")
install.packages(to_install,
repos = "https://cloud.r-project.org")
} else {
print("Required packages already installed")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.