s3io_write(obj, bucket, key, writefun, ..., .localfile = tempfile(),
  .rm_localfile = TRUE, .put_object_args = list())

Arguments

obj

The object to write.

bucket

[string] AWS S3 bucket name.

key

[string] AWS S3 object key.

writefun

[function] A write function where the first argument is the object to write and the second argument is a filepath. The function's signature should look like writefun(obj, file, ...).

...

Additional arguments passed on to writefun.

.localfile

[string] The local filepath for the initial write-to-disk.

.rm_localfile

[boolean] Remove localfile once the copy-to-S3 is complete?

.put_object_args

[list] Additional optional args passed on to awscli::s3api_put_object. A common option you may want to specify, e.g., is content-type: .put_object_args = list("content-type" = "application/json").

Value

The returned value from writefun.

Examples

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