knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" )
library(hoffr) meanf <- hof(mean) mean_noNA <- meanf(na.rm = TRUE) mean_NA <- meanf(na.rm = FALSE) mean_trim <- meanf(trim = 0.25) mean_noNA(c(1, NA, 3)) mean_NA(c(1, NA, 3)) mean_trim(c(-3.5, 0, 2, 100)) mean_trim_noNA <- mean_trim(na.rm = TRUE) mean_trim_noNA(c(-3.5, 0, 2, NA, 100))
You can install hoffr from github with:
# install.packages("devtools") devtools::install_github("hughjonesd/hoffr")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.