datadrop_download: Download DoH Data Drop file via its Google Drive ID

Description Usage Arguments Value Author(s) Examples

View source: R/utilities.R

Description

Download DoH Data Drop file via its Google Drive ID

Usage

1
datadrop_download(id, path = NULL, overwrite = FALSE, verbose = TRUE)

Arguments

id

A 33-character string identifier for the Google Drive file.

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.

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 file downloaded into specified path

Author(s)

Ernest Guevarra

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
  library(googledrive)

  ## Authentication
  googledrive::drive_auth_configure(api_key = Sys.getenv("GOOGLEDRIVE_TOKEN"))

  ## Deauthorise
  googledrive::drive_deauth()

  ## Get Google Drive ID for Case Information file in latest DoH Data Drop
  id <- datadrop_id_file(tbl = datadrop_ls(id = datadrop_id()),
                         fn = "Metadata - Sheets.csv")

  ## Download the Case Information file into tempfile()
  datadrop_download(id = id, path = tempfile())

## End(Not run)

como-ph/covidphdata documentation built on Dec. 31, 2020, 10:06 p.m.