Skip to content

Instantly share code, notes, and snippets.

@erikerhardt
Created July 13, 2021 05:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erikerhardt/57b7826c3ff9325a4e57e0c99353d675 to your computer and use it in GitHub Desktop.
Save erikerhardt/57b7826c3ff9325a4e57e0c99353d675 to your computer and use it in GitHub Desktop.
```{r codebook}
# http://sandsynligvis.dk/articles/18/codebook.html
# https://github.com/ekstroem/dataMaid
#library(dataMaid)
#dataMaid::makeCodebook(dat_PreScr, replace = TRUE, openResult = FALSE, codebook = TRUE)
#dataMaid::makeCodebook(dat_Elig , replace = TRUE, openResult = FALSE, codebook = TRUE)
#dataMaid::makeCodebook(dat_pdp , replace = TRUE, openResult = FALSE, codebook = TRUE)
# Author's blog posts on using
# https://sandsynligvis.dk/2017/08/21/datamaid-your-personal-assistant-for-cleaning-up-the-data-cleaning-process/
# https://sandsynligvis.dk/2018/03/03/generating-codebooks-in-r/
# Descriptions:
# attr(iris$Sepal.Length, "shortDescription") <-
# "Measured using a line gauge produced by Acme factories."
# attr(iris$Species, "shortDescription") <- paste0(
# "Two of the three species were collected in the Gasp ",
# "Peninsula all from the same pasture, and picked on the ",
# "same day and measured at the same time by the same ",
# "person with the same apparatus")
library(dataReporter)
dataReporter::makeCodebook(dat_PreScr, reportTitle = "UNM PDP Prescreening" , replace = TRUE, openResult = FALSE, codebook = TRUE, output = "html", maxProbVals = 20)
dataReporter::makeCodebook(dat_Elig , reportTitle = "UNM PDP Eligibility" , replace = TRUE, openResult = FALSE, codebook = TRUE, output = "html", maxProbVals = 20)
dataReporter::makeCodebook(dat_pdp , reportTitle = "UNM PDP Longitudinal Surveys" , replace = TRUE, openResult = FALSE, codebook = TRUE, output = "html", maxProbVals = 20)
dataReporter::makeCodebook(dat_PreScr, reportTitle = "UNM PDP Prescreening" , replace = TRUE, openResult = FALSE, codebook = TRUE, output = "pdf" , maxProbVals = 20)
dataReporter::makeCodebook(dat_Elig , reportTitle = "UNM PDP Eligibility" , replace = TRUE, openResult = FALSE, codebook = TRUE, output = "pdf" , maxProbVals = 20)
dataReporter::makeCodebook(dat_pdp , reportTitle = "UNM PDP Longitudinal Surveys" , replace = TRUE, openResult = FALSE, codebook = TRUE, output = "pdf" , maxProbVals = 20)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment