Added support for recoding custom variables#24
Conversation
R/recode-with-table.R
Outdated
| no_custom_variables_variable_details <- variable_details | ||
| # If the custom variable isn't in the variable details sheet then this | ||
| # is a pre custom variable sheet. Don't run the code. | ||
| if(variable_details_columns$custom_variable$name %in% colnames(variable_details)) { |
There was a problem hiding this comment.
@yulric variable_details_columns in which line is this variable defined?
There was a problem hiding this comment.
It comes from these lines in strings.R.
You probably have more insight into this but what's the best way to use variables from other files? Do you just source that file or call it from the package namespace, so recodeflow:::variable_details_columns?
There was a problem hiding this comment.
On a more general note, why is it necessary to manually create a new environment and bind names to strings?
There was a problem hiding this comment.
It isn't and we've moved away from that in new code.
We started doing this because we were not sure about the R convention regarding the declaration of non-function variables in a package but since realized it does not add any value to store them in a separate environment.
This file requires quite a bit of refactoring....
Problem: - customVariable feature needed a more descriptive name Solution: - replace all instances with templateVariable in both code and comments Files changed: - R/recode-with-table.R - R/strings.R - tests/testthat/test-custom-variables.R
Files Changes