#' Require Package
#'
#' Install package if it is not already installed.
#'
#' @param package package name(s).
#'
#' @return Logical indicating whether the package is ready to be loaded.
#'
#' @importFrom utils install.packages installed.packages
#'
#' @export
Require <- function(package)
{
if(length(package) > 1)
{
sapply(package, Require)
}
else
{
## Check if package is already installed
if(!(package %in% rownames(installed.packages())))
install.packages(package)
## Indicate whether package is installed
package %in% rownames(installed.packages())
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.