knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The cheese
package contains tools for working with data during statistical analysis--promoting flexible, intuitive, and reproducible workflows. There are functions designated for specific statistical tasks such as
univariate_table()
: To create a custom table of descriptive statistics for a datasetunivariate_associations()
: For computing pairwise association metrics for combinations of predictors
and responses
descriptives()
: To compute descriptive statistics on columns of a datasetThese are built on a collection of data manipulation tools designed for general use, many of which are motivated by the functional programming concept (i.e. purrr
) and use non-standard evaluation for column selection as in dplyr::select
. Here are a few:
depths()
: Find the depth(s) of elements in a list structure that satisfy a predicatedivide()
and fasten()
: Split/bind data frames to/from any list depthdish()
: Evaluate a function with pairwise combinations of columnsstratiply()
: Evaluate a function on subsets of a data frametyply()
: Evaluate a function on columns that inherit at least one (or none) of the specified classesinstall.packages("cheese")
devtools::install_github("zajichek/cheese")
#Load package require(cheese) #Make a descriptive table heart_disease %>% univariate_table( format = "markdown" #Could also render as "html", "latex", "pandoc", or "none" ) #Run some models heart_disease %>% #Apply a function to subsets of the data stratiply( by = Sex, f = ~.x %>% #Apply a function to pairwise combinations of columns dish( left = c(ExerciseInducedAngina, HeartDisease), f = function(y, x) glm(y ~ x, family = "binomial") %>% purrr::pluck("coefficients") %>% tibble::enframe() ) ) %>% #Bind rows up to a specified depth fasten( into = c("Outcome", "Predictor"), depth = 1 )
See the package vignettes and documentation for more thorough examples.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.