Download 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
)

Arguments

file_paths

A character vector of file paths on OSF to download

osf_node_id

The OSF node ID where the files are stored (default: "pr6wu")

local_base_dir

Base directory to save files locally (default: here::here("data"))

debug

Logical, whether to print debugging information (default: TRUE)

skip_existing

Logical, skip downloading a file if a file with that name already exists in that path locally

max_retries

Maximum number of retry attempts for server errors (default: 3)

retry_delay

Delay in seconds between retry attempts (default: 5)

Value

returns paths to downloaded files

Examples

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"
)
} # }