moved metadata names into a sysdata file

This commit is contained in:
Paul W. Egeler, M.S., GStat 2019-06-24 13:48:18 -04:00
parent 7a83e4bc45
commit c0428f880f
4 changed files with 12 additions and 8 deletions

View File

@ -2,3 +2,4 @@
^\.Rproj\.user$ ^\.Rproj\.user$
^\.travis\.yml$ ^\.travis\.yml$
^appveyor\.yml$ ^appveyor\.yml$
^data-raw$

View File

@ -87,14 +87,7 @@ REDCap_split <- function(records, metadata) {
} }
# Standardize variable names for metadata # Standardize variable names for metadata
names(metadata) <- c( names(metadata) <- metadata_names
"field_name", "form_name", "section_header", "field_type",
"field_label", "select_choices_or_calculations", "field_note",
"text_validation_type_or_show_slider_number", "text_validation_min",
"text_validation_max", "identifier", "branching_logic", "required_field",
"custom_alignment", "question_number", "matrix_group_name", "matrix_ranking",
"field_annotation"
)
# Make sure that no metadata columns are factors # Make sure that no metadata columns are factors
metadata <- rapply(metadata, as.character, classes = "factor", how = "replace") metadata <- rapply(metadata, as.character, classes = "factor", how = "replace")

BIN
R/R/sysdata.rda Normal file

Binary file not shown.

View File

@ -0,0 +1,10 @@
metadata_names <- c(
"field_name", "form_name", "section_header", "field_type",
"field_label", "select_choices_or_calculations", "field_note",
"text_validation_type_or_show_slider_number", "text_validation_min",
"text_validation_max", "identifier", "branching_logic", "required_field",
"custom_alignment", "question_number", "matrix_group_name", "matrix_ranking",
"field_annotation"
)
usethis::use_data(metadata_names, overwrite = TRUE, internal = TRUE)