knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-"
)

dinner.table()

The goal of dinner.table() is to make some nice tables.

Installation

You can install dinner.table from github with:

# install.packages("devtools")
devtools::install_bitbucket("ludaj/dinner.table")

Examples

library(tidyverse)
library(kableExtra)
devtools::install_bitbucket("ludaj/dinner.table")
library(dinner.table)
data("diamonds")

n_pct()

The n_pct() function gives a nicely formatted table for a categorical variable with the count and percent for each category. The table is arranged using the percent in descending order so that the biggest categories are at the top of the table.

dinner.table::n_pct(diamonds, cut)

n_pct_fct()

The n_pct_fct() function gives a nicely formatted table for a factor variable with the count and percent for each factor. The table is arranged using the factor levels so that the preferred order is maintained.

dinner.table::n_pct_fct(diamonds, cut)

shelve()

The shelve() function gives a nicely formatted table giving the Q1, Median, Mean, and Q3 for a continous variable that is broken down by categories from a categorical variable

dinner.table::shelve(diamonds, cut, price)


ljanda/dinner.table documentation built on May 21, 2019, 2:30 a.m.