s3_share: Share Amazon S3 file

View source: R/s3_share.r

s3_shareR Documentation

Share Amazon S3 file

Description

Shares Amazon S3 file(s) and returns either a url or R script. The latter is particularly useful for batch downloads and specifying file save paths.

Usage

s3_share(file, out = stdout(), expiration = 168, r)

Arguments

file

Character vector of files to share.If path is included, it will be included in the download script save location.

out

A connection object or character string, as in ⁠[writeLines()]⁠, to which R commands are to be saved. If nothing is supplied, output is to console.

expiration

How long until URLs expire (in hours)? Numeric. Default: 168 (1 week).

r

Output R code (as opposed to link)? By default, the function will return links if out=stdout() and R code if out otherwise. However, this can be overridden by explicitly setting r to be TRUE or FALSE.

Details

Requires aws command line functionality.

Examples

## Not run: 
s3_share('~/web/pdf/BrehenyCV.pdf')
s3_share(c('~/web/pdf/BrehenyCV.pdf', '~/web/pdf/mnet.pdf'), r=TRUE)

## End(Not run)

pbreheny/breheny documentation built on Sept. 5, 2024, 6:45 p.m.