Learn R Programming

cloudfs (version 0.1.3)

cloud_s3_upload: Upload a local file to S3

Description

Uploads a local file from the project's directory to its corresponding location within the project's S3 root folder.

Usage

cloud_s3_upload(file, root = NULL)

Value

Invisibly returns NULL after successfully uploading 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()
# create a toy csv file
dir.create("toy_data")
write.csv(mtcars, "toy_data/mtcars.csv")

# uploads toy_data/mtcars.csv to 'data' subfolder of project's S3 folder
cloud_s3_upload("toy_data/mtcars.csv")

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

Run the code above in your browser using DataLab