-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include in-text survey items when splitting
Before survey items were only found by matching /"^(?:Pre|Post)survey_"/. Instead, a new `survey_item_references` is generated from `survey_item_references.csv` using the script in `survey_item_references.r`. This list of reference IDs is used when splitting out the survey items.
- Loading branch information
Showing
4 changed files
with
26 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
survey_item_references <- read.csv('./data-raw/survey_item_references.csv', na.strings = c("", "NA")) | ||
|
||
logicals <- stringr::str_starts(names(survey_item_references), 'included_v') | ||
survey_item_references[logicals] <- lapply(survey_item_references[logicals], as.logical) | ||
|
||
survey_item_references[!logicals] <- lapply(survey_item_references[!logicals], as.character) | ||
|
||
usethis::use_data(survey_item_references, internal = TRUE, overwrite = TRUE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters