download_nit() downloads records from the New Interview Tool (NIT) project
download_nca() downloads records from the New Case Assignment (NCA) project
download_nit( api_token = Sys.getenv("redcap_NIT_token"), headers = c("raw", "label"), values = c("label", "raw"), filter = NULL, fields = c("record_id", "date", "numb_contacts_16", "start", "specimendate", "case_interview_complete"), dir = "V:/EPI DATA ANALYTICS TEAM/COVID SANDBOX REDCAP DATA/Data for R/nit/", file = paste0("nit_data_", str_date(), ".csv"), force = FALSE ) download_nca( api_token = Sys.getenv("redcap_NCA_token"), headers = c("raw", "label"), values = c("label", "raw"), filter = NULL, fields = NULL, dir = "V:/EPI DATA ANALYTICS TEAM/COVID SANDBOX REDCAP DATA/Data for R/nca/", file = paste0("nca_data_", str_date(), ".csv"), force = FALSE )
| api_token |
|
|---|---|
| headers |
|
| values |
|
| filter |
|
| fields |
|
| dir |
|
| file |
|
| force | Should the download overwrite an existing file, if one exists?
The default is |
The path to the data as an fs_path character vector
if (FALSE) { # Download the current NIT data download_nit() # Download NIT and load immediately nit_data <- load_nit(download_nit()) # Do the same with pipe (`%>%`) nit_data <- download_nit() %>% load_nit() # Overwrite the previous file download_nit(force = TRUE) # Download NCA data download_nca() # Download NCA and overwrite previous file nca_data <- download_nca() %>% load_nca() }