#' Installs Github Packages using R environment variables
#' @param git_username R environment variables that are named in format {git_username}_github_packages
#' @importFrom stringr str_remove_all
#' @importFrom devtools install_github
#' @export
#'
install_github_packages <-
function(git_username) {
renvir_variable_name <- paste0(git_username, "_github_packages")
renvir_variable_value <- Sys.getenv(renvir_variable_name)
if (renvir_variable_value != "") {
package_names <- unlist(strsplit(renvir_variable_value, split = ", "))
repos <- paste0(git_username, "/", package_names)
for (i in 1:length(repos)) {
devtools::install_github(repos[i], quiet = TRUE)
Sys.sleep(1)
}
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.