# TODO
# add tests
# from rlang::is_installed()
is_installed <- function(pkg) {
identical(requireNamespace(pkg, quietly = TRUE), TRUE)
}
set_names <- function(x, nm) {
names(x) <- nm
x
}
strw_count <- function(string, pattern, perl = FALSE, fixed = FALSE) {
out <- nchar(string) - nchar(gsub(pattern, "", string, perl = perl, fixed = fixed))
out / nchar(pattern)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.