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
)

Arguments

tbl

A tibble output produced by datadrop_ls() that lists the files within a particular DoH Data Drop Google Drive folder

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 tbl.

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 path. If path is NULL, the file is kept in the working directory using the default file name used in Google Drive.

overwrite

Logical. If path already exists, should it be overwritten? Default to FALSE.

verbose

Logical. Should operation progress messages be shown? Default to TRUE.

Value

A tibble of any of the following datasets:

  1. Metadata - Sheets;

  2. Metadata - Fields;

  3. Case Information;

  4. DOH Data Collect - Daily Report;

  5. DOH Data Collect - Weekly Report;

  6. Testing Aggregates;

  7. Quarantine Facility Data - Daily Report;

  8. Quarantine Facility Data - Weekly Report;

  9. DOH Data Collect v3 - Baseline;

  10. DOH Data Collect v4 - Baseline; and,

  11. 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.

Examples

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())