Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# authenticate using OSF token stored in .Renviron
# define download function
download_project <- function(node, path) {
proj <- osfr::osf_retrieve_node(node)
files <- osfr::osf_ls_files(proj)
if(!dir.exists(path)) dir.create(path)
for(i in 1:nrow(files)) {
cat("downloading: ", files$name[i], "\n")
osfr::osf_download(files[i,], file.path(path, files$name[i]))
# the devil and deep blue sea OSF project:
download_project(node = "5swnm", path = "~/Desktop/devil")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.