s3io_read(bucket, key, readfun, ..., .localfile = tempfile(),
  .rm_localfile = TRUE, .get_object_args = list())

Arguments

bucket

[string] AWS S3 bucket name.

key

[string] 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

[string] The local filepath of the downloaded file.

.rm_localfile

[boolean] 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.

.get_object_args

[list] Additional optional args passed on to awscli::s3api_get_object.

Value

The returned value from readfun.

Examples

# NOT RUN {
  s3io_read("mybucket", "my/object/key.csv", readr::read_csv, col_names = TRUE)
# }