Add config update file to create participants file

pull/103/head
JulioV 2020-10-28 14:11:41 -04:00
parent 8f74d3f3b7
commit f36a7052b3
2 changed files with 10 additions and 2 deletions

View File

@ -15,7 +15,7 @@ CREATE_PARTICIPANT_FILES:
TYPE: AWARE_DEVICE_TABLE #AWARE_DEVICE_TABLE or CSV_FILE
DATABASE_GROUP: *database_group
CSV_FILE_PATH: "data/external/example_participants.csv" # must have columns: PHONE DEVICE_ID_COLUMN, FITBIT DEVICE_ID_COLUMN, pid , label, start_date, end_date
TIMEZONE: *timezone # only used for AWARE_DEVICE_TABLE
TIMEZONE: *timezone
PHONE_SECTION:
ADD: TRUE
DEVICE_ID_COLUMN: device_id # column name

View File

@ -70,4 +70,12 @@ participants %>%
writeLines(lines, file_connection)
close(file_connection)
}, add_phone_section, add_fitbit_section, phone_device_id_column, fitbit_device_id_column)
}, add_phone_section, add_fitbit_section, phone_device_id_column, fitbit_device_id_column)
file_lines <-readLines("./config.yaml")
for (i in 1:length(file_lines)){
if(startsWith(file_lines[i], "PIDS:")){
file_lines[i] <- paste0("PIDS: [", paste(participants$pid, collapse = ", "), "]")
}
}
writeLines(file_lines, con = "./config.yaml")