Learn R Programming

cloudfs (version 0.1.3)

cloud_s3_download: Download a file from S3 to the local project folder

Description

Retrieves a file from the project's S3 root folder and saves it to the local project folder, maintaining the original folder structure.

Usage

cloud_s3_download(file, root = NULL)

Value

Invisibly returns NULL after successfully downloading the file.

Arguments

file

Path to a file relative to project folder root. Can contain only letters, digits, '-', '_', '.', spaces and '/' symbols.

root

S3 path of the project root. This serves as the reference point for all relative paths. When left as NULL, the root is automatically derived from the cloudfs.s3 field of the project's DESCRIPTION file.

Examples

Run this code
if (FALSE) { # interactive()
# downloads toy_data/demo.csv from project's S3 folder (provided it exists)
# and saves it to local 'toy_data' folder
cloud_s3_download("toy_data/demo.csv")

# clean up
unlink("toy_data", recursive = TRUE)
}

Run the code above in your browser using DataLab