s3io_read: Read a file in from AWS S3

View source: R/s3io_read.R

s3io_readR Documentation

Read a file in from AWS S3

Description

Read a file in from AWS S3

Usage

s3io_read(
  bucket,
  key,
  readfun,
  ...,
  .localfile = fs::file_temp(),
  .rm_localfile = TRUE,
  .opts = NULL
)

Arguments

bucket

<chr(1)> AWS S3 bucket name.

key

<chr(1)> AWS S3 object key.

readfun

<function> A read function where the first argument is a filepath. The function's signature should look like readfun(file, ...).

...

Additional arguments forwarded on to readfun.

.localfile

<chr(1)> The local filepath of the downloaded file.

.rm_localfile

<lgl(1)> Should the local filepath be deleted once it has been read? If rm_localfile = TRUE, then the read operation should read the entire file into memory.

.opts

<dict> AWS CLI additional –opts, if not the default (from awscli2).

Value

The returned value from readfun.

Examples

## Not run: 
  s3io_read("mybucket", "my/object/key.csv", readr::read_csv, col_names = TRUE)

## End(Not run)

mmuurr/s3io documentation built on Jan. 5, 2023, 2:19 p.m.