knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(tidyverse) library(bfuncs)
By default, codebook
assumes that you want to make a codebook about a dataset file that you have saved somewhere, as opposed to a data frame you're working on in an r session, but don't intend to save. Therefore, the first thing you will need to do is read the data into the current R session.
For the purposes of making a self-contained example, we will actually just create an example data frame in the code chunk below and use it to demonstrate how to use codebook
set.seed(123) df <- tibble( id = factor(seq(1001, 1020, 1)), gender = sample(c("Female", "Male"), 20, TRUE), date = sample(seq.Date(as.Date("2015-09-15"), as.Date("2015-10-26"), "day"), 20, TRUE), height = rnorm(20, 71, 10) ) %>% print()
codebook
classifies all columns as one of four types and uses these categories to determine which descriptive statistics are given in the codebook document:
id
above gender
above date
above height
above Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.