Hello everyone,
I am using R 3.6.3 on Ubuntu Desktop 20.04 and googledrive version 1.0.1
I am downloading data from this open google drive folder with about 3k files: https://drive.google.com/drive/folders/0B-owdnU_9_lpei1wbTBpS3RyTW8?resourcekey=0-SxZAhXpvnVSBVJjG_HYZ_w
if you add it to a google account of yours you can see that it has troubles in retrieving some data (not all):
library(googledrive)
drive_about()
s2012 <- drive_ls(path = "CSV Stazione_Parametro_AnnoMese", pattern = paste0("storico_2012"))
drive_download(file = as_id(s2012$id[1]))
Which returns:
Error: Client error: (404) Not Found
* domain: global
* reason: notFound
* message: File not found: 0B-owdnU_9_lpY0otY3FYaF9nOG8.
* locationType: parameter
* location: fileId
Run `rlang::last_error()` to see where the error occurred.
> rlang::last_error()
<error/gargle_error_request_failed>
Client error: (404) Not Found
* message: File not found: 0B-owdnU_9_lpSGR2SGtCUnlRekk.
* domain: global
* reason: notFound
* location: fileId
* locationType: parameter
Backtrace:
1. base::mapply(function(x) drive_download(file = as_id(x)), bla$id)
3. googledrive::drive_download(file = as_id(x))
5. googledrive:::as_dribble.drive_id(file)
6. googledrive::drive_get(id = x)
8. purrr::map(as_id(id), get_one_file)
9. googledrive:::.f(.x[[i]], ...)
10. gargle::response_process(response)
11. gargle:::stop_request_failed(error_message(resp), resp)
Run `rlang::last_trace()` to see the full context.
Note that the tibble of drive_ls is:
s2012
# A tibble: 201 x 3
name id drive_resource
* <chr> <chr> <list>
1 storico_2012_07000027_005.csv 0B-owdnU_9_lpY0otY3FYaF9nOG8 <named list [37]>
2 storico_2012_10000001_005.csv 0B-owdnU_9_lpcmFkUDYwUzh4X0k <named list [37]>
3 storico_2012_05000020_010.csv 0B-owdnU_9_lpcTlEMTFpbjJLSVE <named list [37]>
4 storico_2012_03000006_005.csv 0B-owdnU_9_lpbDJiNFZWUy1CcEU <named list [37]>
5 storico_2012_09000018_111.csv 0B-owdnU_9_lpRHlwN0JnNVNseDg <named list [37]>
6 storico_2012_07000041_005.csv 0B-owdnU_9_lpV1hINnZtSFRYaTg <named list [37]>
7 storico_2012_04000155_009.csv 0B-owdnU_9_lpMzh6a29BQ3hJbHM <named list [37]>
8 storico_2012_09000014_020.csv 0B-owdnU_9_lpS0Y0ZFIzbV9mX1U <named list [37]>
9 storico_2012_03000006_038.csv 0B-owdnU_9_lpMlpGbkpFdVdURzQ <named list [37]>
10 storico_2012_06000036_009.csv 0B-owdnU_9_lpa0kxTTBuLU83U2s <named list [37]>
# … with 191 more rows
Note that it perfectly works for other files in the same folder, e.g.:
s2020 <- drive_ls(path = "CSV Stazione_Parametro_AnnoMese", pattern = paste0("storico_2020"))
drive_download(file = as_id(s2020$id[1]))
Any hint?
A question aside: googledrive
sometimes struggles to find all files available based a specific pattern, i.e. it has be run multiple times to find them all. I guess it is normal, isn't it?
Thx,
A