codebook: Automate creation of a data codebook

Description Usage Arguments Details Value Examples

View source: R/codebook.R

Description

The codebook function assists with the creation of a codebook for a given data frame.

Usage

1
2
codebook(df, path = NA, title = NA, subtitle = NA,
  description = NA)

Arguments

df

The saved file at 'path', read into memory as a data frame

path

The path to the saved dataset of interest

title

Optional title

subtitle

Optional subtitle

description

Text description of the dataset

Details

Codebook expects that 'df ' is a data frame that you have read into memory from a saved data file. Please provide the path to the saved data file. This function gets selected attributes about file saved at 'path' and stores those attributes in a data frame, which is later turned into a flextable and added to the codebook document.

Value

An rdocx object that can be printed to a Word document

Examples

1
2
3
4
5
6
7
8
# codebook_detect_5wk <- codebook(
#   df = detect_5wk %>% select(1:2),
#   path = "../data/detect_5wk.csv",
#   title = "Detection of Elder abuse Through Emergency Care Technicians (DETECT)",
#   subtitle = "5-Week Pilot Study",
#   description = description
# ) %>%
#   print(target = "example_officer_codebook.docx")

brad-cannell/bfuncs documentation built on July 21, 2019, 10:45 a.m.