Learn R Programming

osfr (version 0.1.1)

download_files: Download files from OSF

Description

This function downloads files from OSF and assumes that the file is public. For private files, the function checks first for a view-only link. If no view-only link is provided, the user's login credentials are used.

Usage

download_files(id, path = NULL, view_only = NULL, version = NULL)

Arguments

id

Specify the file id (osf.io/XXXXX)

path

Specify path to save file to. If NULL, defaults to OSF filename in the working directory

view_only

Specify the view-only link (string)

version

Specify the OSF version id (string)

Value

Return filepath for easy processing

Details

For more information on creating a view-only link see: http://help.osf.io/m/links/l/524049-create-a-view-only-link.

Examples

Run this code
# NOT RUN {
download_files('5z2bh', 'public_test_file.csv')
download_files('852dp', 'view_only_test_file.csv',
  view_only = 'https://osf.io/jy9gm/?view_only=a500051f59b14a988415f08539dbd491')
# }

Run the code above in your browser using DataLab