upload_to_osf: Upload a directory of files to OSF

View source: R/upload_to_osf.R

upload_to_osfR Documentation

Upload a directory of files to OSF

Description

This function makes it convenient to upload a large number of files to an OSF project, particularly when there are many levels of nested sub-folders. It relies on the osfr package.

Usage

upload_to_osf(
  project = "",
  dir = ".",
  skip_files = c(),
  conflicts = c("error", "skip", "overwrite")
)

Arguments

project

An osf_tbl representation created with osfr::osf_retrieve_node()

dir

A file path to a first-level directory in your local project folder. e.g., "data". Do not specifiy second-level directories e.g., "data/raw".

To upload files from the root project folder, specify dir = "." or leave out argument.

skip_files

An array of file/folder names and pattern strings to not include in the upload to OSF. e.g., you might have a folder of "old" scripts or data files that you do not want uploaded.

conflicts

This determines what happens when a file with the same name exists at the specified destination. Can be one of the following: - "error" (the default): throw an error and abort the file transfer operation. - "skip": skip the conflicting file(s) and continue transferring the remaining files. - "overwrite": replace the existing file with the transferred copy.


dr-JT/workflow documentation built on March 19, 2024, 7:51 p.m.