Add config update file to create participants file
parent
8f74d3f3b7
commit
f36a7052b3
|
@ -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
|
||||
|
|
|
@ -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")
|
Loading…
Reference in New Issue