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

meantables meantables hex logo

CRAN status Downloads

The goal of meantables is to quickly make tables of descriptive statistics (i.e., counts, means, confidence intervals) for continuous variables. This package is designed to work in a Tidyverse pipeline, and consideration has been given to get results from R to 'Microsoft Word' ® with minimal pain.

Installation

You can install the released version of meantables from CRAN with:

install.packages("meantables")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("brad-cannell/meantables")

Example

library(dplyr)
library(meantables)
data("mtcars")

Overall mean table with defaults

mtcars %>% 
  mean_table(mpg)

Formatting overall mean and 95% CI

mtcars %>%
  mean_table(mpg) %>%
  mean_format(
    recipe = "mean (lcl - ucl)",
    name = "mean_95",
    digits = 1
  ) %>% 
  select(response_var, mean_95)

Formatting grouped means table with mean and sd

mtcars %>%
  group_by(cyl) %>%
  mean_table(mpg) %>%
  mean_format("mean (sd)") %>% 
  select(response_var:group_cat, formatted_stats)

Grouped means table with defaults

mtcars %>% 
  group_by(cyl) %>% 
  mean_table(mpg)


brad-cannell/meantables documentation built on Aug. 5, 2022, 5:17 a.m.