Skip to content

Commit

Permalink
Merge pull request #10 from ucsf-bhhi/stata-helpers
Browse files Browse the repository at this point in the history
Rename Known Long Variable Names
  • Loading branch information
eveyp authored Apr 1, 2022
2 parents e0dce0e + 2f20e85 commit 892bc86
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: statewide.survey.tools
Title: Statewide Survey Tools
Version: 0.3.4
Version: 0.3.5
Authors@R:
person("Eve", "Perry", , "[email protected]", role = c("aut", "cre"))
Description: Helper tools for the Statewide Survey.
Expand Down
16 changes: 15 additions & 1 deletion R/prepare_for_stata.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
prepare_for_stata = function(data) {
dplyr::rename_with(data, stata_safe_variable_names, everything())
data %>%
dplyr::rename(
precipitants_to_home_v_0 = precipitants_to_homelessness_timestamp,
precipitants_to_home_v_1 = precipitants_to_homelessness_complete,
lumpsumsubsidy_preve_v_2 = lumpsumsubsidy_prevention_timestamp,
lumpsumsubsidy_preve_v_3 = lumpsumsubsidy_prevention_complete,
stable_housing_suppl_v_4 = stable_housing_supplement_timestamp,
stable_housing_suppl_v_5 = stable_housing_supplement_complete,
history_of_homelessn_v_6 = history_of_homelessness_timestamp,
history_of_homelessn_v_7 = history_of_homelessness_complete,
income_employment_an_v_8 = income_employment_and_benefits_timestamp,
income_employment_an_v_9 = income_employment_and_benefits_complete,
healthcare_utilizati_v_10 = healthcare_utilization_timestamp
) %>%
dplyr::rename_with(stata_safe_variable_names, everything())
}

stata_safe_variable_names = function(name) {
Expand Down

0 comments on commit 892bc86

Please sign in to comment.