knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

cheese

CRAN Status CRAN_Download_Counter

Introduction

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

These 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:

Installation

install.packages("cheese")

devtools::install_github("zajichek/cheese")

Usage

#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.



zajichek/cheese documentation built on July 26, 2023, 4:24 p.m.