A wrapper to googledrive
functions to retrieve datasets from the DoH Data
Drop folders.
datadrop_get( tbl, fn, path = NULL, keep = FALSE, overwrite = FALSE, verbose = TRUE ) datadrop_get_changelog( tbl, path = NULL, keep = FALSE, overwrite = FALSE, verbose = TRUE ) datadrop_get_sheets( tbl, path = NULL, keep = FALSE, overwrite = FALSE, verbose = TRUE ) datadrop_get_fields( tbl, path = NULL, keep = FALSE, overwrite = FALSE, verbose = TRUE ) datadrop_get_cases( tbl, path = NULL, keep = FALSE, overwrite = FALSE, verbose = TRUE ) datadrop_get_tests( tbl, path = NULL, keep = FALSE, overwrite = FALSE, verbose = TRUE ) datadrop_get_cdaily( tbl, path = NULL, keep = FALSE, overwrite = FALSE, verbose = TRUE ) datadrop_get_cweekly( tbl, path = NULL, keep = FALSE, overwrite = FALSE, verbose = TRUE ) datadrop_get_qdaily( tbl, path = NULL, keep = FALSE, overwrite = FALSE, verbose = TRUE ) datadrop_get_qweekly( tbl, path = NULL, keep = FALSE, overwrite = FALSE, verbose = TRUE )
tbl | A tibble output produced by |
---|---|
fn | A character string composed of a word or words that can be used to
match to the name of a file within a particular DoH Data Drop
Google Drive folder listed in |
path | A character value for path for output file. If NULL, the default file name used in Google Drive is used and the default location is the working directory. |
keep | Logical. Should file be saved locally? Default to FALSE. If TRUE,
file is kept in the location specified in |
overwrite | Logical. If |
verbose | Logical. Should operation progress messages be shown? Default to TRUE. |
A tibble of any of the following datasets:
Metadata - Sheets;
Metadata - Fields;
Case Information;
DOH Data Collect - Daily Report;
DOH Data Collect - Weekly Report;
Testing Aggregates;
Quarantine Facility Data - Daily Report;
Quarantine Facility Data - Weekly Report;
DOH Data Collect v3 - Baseline;
DOH Data Collect v4 - Baseline; and,
DDC TTMF Tracker v1.
For Changelog, a named list of two tibbles - List of Changes and
Most Common Changes. If keep
is TRUE, a copy of the specified
DoH Data Drop Google Drive file is saved in the location specified by
path
.
if (FALSE) { library(googledrive) ## Authentication googledrive::drive_auth_configure(api_key = Sys.getenv("GOOGLEDRIVE_TOKEN")) ## Deauthorise googledrive::drive_deauth() ## Get tbl for files in latest Data Drop library(magrittr) x <- datadrop_id() %>% datadrop_ls() ## Retrieve case information data datadrop_get(tbl = x, fn = "Case Information", path = tempfile()) ## Retrieve latest changelog information datadrop_get_changelog(tbl = x, path = tempfile()) ## Retrieve latest metadata - sheets information datadrop_get_sheets(tbl = x, path = tempfile()) ## Retrieve latest metadata - fields information datadrop_get_fields(tbl = x, path = tempfile()) ## Retrieve latest cases information (same results as first example) datadrop_get_cases(tbl = x, path = tempfile()) ## Retrieve latest daily hospital beds and mechanical ventilators information datadrop_get_cdaily(tbl = x, path = tempfile()) ## Retrieve latest weekly PPE and other related equipment information datadrop_get_cweekly(tbl = x, path = tempfile()) ## Retrieve latest testing aggregates information datadrop_get_tests(tbl = x, path = tempfile()) ## Retrieve latest daily quarantine facility beds and mechanical ventilators datadrop_get_qdaily(tbl = x, path = tempfile()) ## Retrieve latest weekly quarantine facility PPE and other related equipment datadrop_get_qweekly(tbl = x, path = tempfile()) } #datadrop_get_collectV3(tbl = x, path = tempfile()) #datadrop_get_collectV4(tbl = x, path = tempfile()) #datadrop_get_tracker(tbl = x, path = tempfile())