Files stored on OSF can be downloaded locally by passing an
that contains the files and folders of interest. Use
path to specify
where the files should be downloaded, otherwise they are downloaded to
your working directory by default.
osf_download( x, path = NULL, recurse = FALSE, conflicts = "error", verbose = FALSE, progress = FALSE )
Path pointing to a local directory where the downloaded files will be saved. Default is to use the current working directory.
Applies only to OSF directories. If
This determines what happens when a file with the same name exists at the specified destination. Can be one of the following:
Logical, indicating whether to print informative messages
about interactions with the OSF API (default
osf_tbl_file passed to
x with a new column,
"local_path", containing paths to the local files.
Directories are always downloaded from OSF as zip files that contain its
entire contents. The logic for handling conflicts and recursion is
implemented locally, acting on these files in a temporary location and
copying them to
path as needed. This creates a gotcha if you're
downloading directories with large files and assuming that setting
conflicts = "skip" and/or limiting recursion will reduce the number of files you're
downloading. In such a case, a better strategy would be to use
osf_ls_files() to list the contents of the directory and pass that output
osf_upload() can be used to conveniently shuttle
files back and forth between OSF and your local machine, it's important to
note that they are not file synchronization functions. In contrast to
osf_upload() do not take into account a file's contents or
modification time. Whether you're uploading or downloading, if
overwrite = TRUE, osfr will overwrite an existing file regardless of whether the
existing file is the more recent copy. You have been warned.