#' rcheck
#'
#' Check for and install package if missing
#' @param package name of package
#' @param github_user name of github user, for cran do "NA" or dont use argument
#' @export
rcheck <- function(package="data.table",github_user="NA"){
if(package %in% installed.packages()){
return(paste0(package," INSTALLED AND READY TO USE"))
}else{
if(github_user=="NA"){
install.packages(package)
}else{
suppressWarnings(if(!require("remotes")){install.packages("remotes")})
remotes::install_github(paste0(github_user,"/",package))
}
if(package %in% installed.packages()){
return(paste0(package," INSTALLED AND READY TO USE"))
}else{return(paste0(package," INSTALL FAILED"))}
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.