download_gdrive_if_missing.Rd
This function downloads the specified file from google drive if the destination file does not exist. If it does exist the user will be prompted to download it again.
download_gdrive_if_missing(gfileID, destfile, update_always = FALSE, email)
If the destination file was missing it is downloaded from the googledrive.
Its best practice to provide the email in encrypted form. This can be easily achieved by adding email as an item in a .renviron file or even beter by using more robust encryption methods.
When a PERMISSION_DENIED error occurs, it is likely that the file is not shared
with the email address provided. This can be fixed by sharing the file with the
email address. If the file was shared correctly this might indicate that email address
does not have the correct permissions to access the file. This can be fixed by
running googledrive::drive_auth()
and making sure the
'show, modify and delete all drive files' option is selected. If the error persists
please create a new issue
on the github page.
Other download:
download_dep_media()
,
download_seq_media()
if (FALSE) { # \dontrun{
# download newest version of the team charter
download_gdrive_if_missing(gfileID = "1gtqcZojPnbLhEgpul3r9sy2zK3UyyCVG",
destfile = "../../Teamcharters/Teamcharter_FIS.pdf",
email = Sys.getenv("email"),
update_always = TRUE)
} # }
if (FALSE) { # \dontrun{
# download newest DRG Agouti export
download_gdrive_if_missing(gfileID = "1FX8DDyREKMH1M3iW9ijWjVjO_tBH8PXi",
destfile = "../fis-projecten/Grofwild/Drongengoed/Input/Agouti/drongengoed_240502.zip",
email = Sys.getenv("email"),
update_always = TRUE)
} # }