diff --git a/R/.Rbuildignore b/R/.Rbuildignore index e148253..7f78a9d 100644 --- a/R/.Rbuildignore +++ b/R/.Rbuildignore @@ -2,3 +2,4 @@ ^\.Rproj\.user$ ^\.travis\.yml$ ^appveyor\.yml$ +^data-raw$ diff --git a/R/R/REDCap_split.r b/R/R/REDCap_split.r index 4e45901..14f499d 100644 --- a/R/R/REDCap_split.r +++ b/R/R/REDCap_split.r @@ -87,14 +87,7 @@ REDCap_split <- function(records, metadata) { } # Standardize variable names for metadata - names(metadata) <- 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" - ) + names(metadata) <- metadata_names # Make sure that no metadata columns are factors metadata <- rapply(metadata, as.character, classes = "factor", how = "replace") diff --git a/R/R/sysdata.rda b/R/R/sysdata.rda new file mode 100644 index 0000000..0299f29 Binary files /dev/null and b/R/R/sysdata.rda differ diff --git a/R/data-raw/metadata_names.R b/R/data-raw/metadata_names.R new file mode 100644 index 0000000..30d8c8c --- /dev/null +++ b/R/data-raw/metadata_names.R @@ -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)