Description Usage Arguments Value See Also Examples
Read/write objects from/to S3 using a custom function
1 2 3 | s3write_using(x, FUN, ..., object, bucket, opts = NULL)
s3read_using(FUN, ..., object, bucket, opts = NULL, filename = NULL)
|
x |
For |
FUN |
For |
... |
Additional arguments to |
object |
Character string with the object key, or an object of class “s3_object”. In most cases, if |
bucket |
Character string with the name of the bucket, or an object of class “s3_bucket”. |
opts |
Optional additional arguments passed to |
filename |
Optional string, name of the temporary file that will be created. If not specified, |
For s3write_using
, a logical, invisibly. For s3read_using
, the output of FUN
applied to the file from object
.
s3saveRDS
, s3readRDS
, put_object
,get_object
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ## Not run:
library("datasets")
# create bucket
b <- put_bucket("myexamplebucket")
# save a dataset to the bucket as a csv
if (require("utils")) {
s3write_using(mtcars, FUN = write.csv, object = "mtcars.csv", bucket = b)
}
# load dataset from the bucket as a csv
if (require("utils")) {
s3read_using(FUN = read.csv, object = "mtcars.csv", bucket = b)
}
# cleanup
delete_object(object = "mtcars.csv", bucket = b)
delete_bucket(bucket = b)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.