View source: R/fbs_visit_databases.R
fbs_visit_databases | R Documentation |
This function will generate up-to-date databases for the Food and Brain Study based on visit only. If multiple visits are entered, the data will be merged into a signle database
fbs_visit_databases(
visit1 = FALSE,
visit2 = FALSE,
visit3 = FALSE,
visit4 = FALSE,
visit5 = FALSE,
visit6 = FALSE,
visit7 = FALSE,
model_DD = FALSE,
write_dat = TRUE,
write_path,
return_data = FALSE,
data_path,
child_file_pattern,
parent_file_pattern,
visit_file_pattern
)
visit1 |
(optional) logical indicator if want visit 1 data in database. Default = FALSE. |
visit2 |
(optional) logical indicator if want visit 2 data in database. Default = FALSE. |
visit3 |
(optional) logical indicator if want visit 3 data in database. Default = FALSE. |
visit4 |
(optional) logical indicator if want visit 4 data in database. Default = FALSE. |
visit5 |
(optional) logical indicator if want visit 5 data in database. Default = FALSE. |
visit6 |
(optional) logical indicator if want visit 6 data in database. Default = FALSE. |
visit7 |
(optional) logical indicator if want visit 7 data in database. Default = FALSE. |
model_DD |
If visit3 is set to TRUE, indicate if delay discounting data should be modeled. This will take an addition 3-5 minutes of processing time. Default = FALSE. |
write_dat |
indicate whether to write databases. Default is TRUE. |
write_path |
(optional) a string with the path indicating where to save the generated databases if write_dat is TRUE (default option). If no path is given, databases will be written to working directory. |
return_data |
indicate whether to return databases to the environment. Default is FALSE. |
data_path |
(optional) the full path to the directory where the raw Qualtrics database are saved, EXCLUDING the .sav file name (e.g., '.../b-childfoodlab_Shared/Active_Studies/RO1_Brain_Mechanisms_IRB_5357/Participant_Data/untouchedRaw/Qualtrics_Raw/'). If NOT entered, will assume the database is saved in the working directory. |
child_file_pattern |
(optional) This is only needed if file naming deviates from the standard naming: e.g., Child_V#_*sav'. Only enter the string indicating a respondent (e.g., 'Child'). |
parent_file_pattern |
(optional) This is only needed if file naming deviates from the standard naming: e.g., Parent_V#_*sav'. Only enter the string indicating a respondent (e.g., 'Child'). |
visit_file_pattern |
(optional) This is only needed if file naming deviates from the standard naming for visits: e.g., V# . Only enter the string indicating a visit (e.g., 'V' for 'V1' or 'Visit_' for 'Visit_1'). |
To process the raw data, the raw databases from Qualtrics MUST follow the naming convention: Child_V1_YYYY-MM-DD.sav, Child_V1_Home_YYY-MM-DD.sav, Child_V1_Lab_YYY-MM-DD.sav, and Parent_V1_YYY-MM-DD.sav. The databases must all be in the SAME directory to be processed if the data_path is not entered and the directory organization does not follow the structure laid out in the DataManual.
A list containing all databases that were generated
Raw data from Qualtrics is processed using the following scripts: util_fbs_merge_v1dat
, util_fbs_merge_v2dat
, util_fbs_merge_v3dat
, util_fbs_merge_v4dat
, util_fbs_merge_v5dat
, util_fbs_merge_v6dat
, util_fbs_merge_v7dat
#if in same working directory as data, want delay discounting data modeled:
fbs_data_proc <- fbs_visit_databases(visit3 = TRUE, model_DD = TRUE)
#if only want the full visit 1 database returned to the terminal:
fbs_data_proc <- fbs_visit_databases(visit1 = TRUE, write_dat = FALSE)
#if want the visit 1 and visit 6 data written to the working directory:
fbs_data_proc <- fbs_visit_databases(visit1 = TRUE, visit6 = TRUE)
## Not run:
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.