knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(utilitarian)
Don't know if something is installed? Want your code to install packages when run if they're absent? usePackage
is here to help!
usePackage("dichromat")
Combine usePackage()
with the purrr
package to attempt to attach and (install if unavailable) multiple packages.
Walk doesn't return an output, only the secondary effects. In this case, an attached package from each of those in the character vector.
purrr::walk(c("DT", "dplyr", "lubridate", "readr", "ggplot2", "ggridges", "viridis", "hrbrthemes", "forcats", "tidyr"), ~ usePackage(.x))
Tired of quoting and typing in multiple library statements? No more!
Don't bother with quotes. Just type your package names in and off you go.
libraries(dichromat, jsonlite) sessionInfo()
Like library()
but better.
libraries("dichromat", "jsonlite", quoted = T) sessionInfo()
Like library()
but even better.
mypkgs <- c("dichromat", "jsonlite") libraries(mypkgs, quoted = T) sessionInfo()
Because you like R to talk back.
libraries(dichromat, verbose = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.