- Navigate to folder in
data_raw - Add code to read in CSV/similar to
process_data_sets_*.Rand give DATA_SET_NAME
- Clean data set if needed
- Open README.md if exists in folder
- Open Meta tab to Data to feed R pkg documentation Google Sheet and add DATA_SET_NAME to
DATA_SET_NAMEcolumn
- Copy
TITLEandLINKfrom README.md - Get
nrow(DATA_SET_NAME)andncol(DATA_SET_NAME)and copy intoNUM_ROWSandNUM_COLScolumns - Determine
OBSUNITand fill in column - Find source in README.md or look over article linked at https://github.com/fivethirtyeight/data
- Add DATA_SET_NAME to
DATA_SET_NAMEcolumn in Variables data tab of Data to feed R pkg documentation Google Sheet
- Run
get_names <- function(x) {cat(names(x), sep = "\n")}; get_names(x)withx = DATA_SET_NAME - Copy values into
VARNAMEcolumn - Copy md table from README.md into
VAR_DESC_FULL VAR_DESCis automatically created using Excel formula:=IF(C2="","", TRIM(RIGHT(C2,LEN(C2)-FIND("|",C2) - 1)))
- Source
data-raw/create_doc.R - Run
devtools::use_data(DATA_FRAME, overwrite = TRUE)code to create Rdata file inprocess_data_sets_*.R - Build & Reload package using Command + Shift + B (on Mac)
- Also creates R documentation if settings checked