remove_attr <- function(x, ...) {
for (name in rlang::list2(...)) {
attr(x, name) <- NULL
}
x
}
remove_class <- function(x, ...) {
cls <- class(x)
class(x) <- cls[!cls %in% rlang::list2(...)]
x
}
return_if <- function(.p, .val = invisible(), .envir = parent.frame()) {
if (.p) {
do.call(return, list(substitute(.val)), envir = .envir)
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.