R/peekbankr.R
download_osf_files.RdDownload a list of files from OSF and recreate folder structure locally
download_osf_files(
file_paths,
osf_node_id = "pr6wu",
local_base_dir = "data",
debug = F,
skip_existing = TRUE,
max_retries = 3,
retry_delay = 5
)A character vector of file paths on OSF to download
The OSF node ID where the files are stored (default: "pr6wu")
Base directory to save files locally (default: here::here("data"))
Logical, whether to print debugging information (default: TRUE)
Logical, skip downloading a file if a file with that name already exists in that path locally
Maximum number of retry attempts for server errors (default: 3)
Delay in seconds between retry attempts (default: 5)
returns paths to downloaded files
if (FALSE) { # \dontrun{
# Download multiple files from OSF
download_osf_files(
file_paths = c(
"lab1/raw_data/file1.csv",
"lab2/processed_data/file2.csv"
),
osf_node_id = "pr6wu"
)
} # }