Skip to content

Instantly share code, notes, and snippets.

@jtrecenti
Created May 14, 2021 21:59
Show Gist options
  • Save jtrecenti/310c26c09f598116949198414dc14493 to your computer and use it in GitHub Desktop.
Save jtrecenti/310c26c09f598116949198414dc14493 to your computer and use it in GitHub Desktop.
library(magrittr)
id <- googledrive::as_id("1cBZc8_YqZB7bQYxjn9G9tHfggT77plk5UggSaW08jQqgWWoaskST5uFh4YcPtPLeL57se_Db")
infos <- googledrive::drive_ls(id)
dados_arquivos <- infos %>%
dplyr::mutate(pessoa = purrr::map_chr(
drive_resource, purrr::pluck, "lastModifyingUser", "displayName"
)) %>%
dplyr::mutate(
pessoa = janitor::make_clean_names(pessoa),
nome_arquivo = paste0(pessoa, "_", name)
)
path <- "~/Downloads/correcao_ex1"
fs::dir_create(path)
with(dados_arquivos, purrr::walk2(id, nome_arquivo, ~{
message(.y)
id <- googledrive::as_id(.x)
googledrive::drive_download(id, paste0(path, "/", .y))
}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment