#' @title Detach a package
#'
#' @description
#' Wrapper function around library and detach
#' to detach packages.
#'
#' @param x character vector.
#' Names of packages to detach.
#'
#' @export
.detach_pkg <- function(x) {
for (xx in x) {
library(xx, character.only = TRUE)
args_list <- list(
name = paste0("package:", xx),
unload = TRUE,
character.only = TRUE
)
do.call(
what = "detach",
args = args_list
)
}
invisible(TRUE)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.