knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" )
The goal of dinner.table() is to make some nice tables.
You can install dinner.table from github with:
# install.packages("devtools") devtools::install_bitbucket("ludaj/dinner.table")
library(tidyverse) library(kableExtra) devtools::install_bitbucket("ludaj/dinner.table") library(dinner.table) data("diamonds")
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)
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)
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.