Description Usage Arguments Details Note See Also Examples
Any type of object that can be serialized as an RDS file is capable of being retrieved using this interface.
1 2 3 |
obj |
ANY. An R object to save to S3. |
name |
character. The S3 key to save to. If no key is provided,
the expression passed as |
path |
character. The S3 prefix, e.g., "s3://yourbucket/some/path/". |
safe |
logical. Whether or not to overwrite existing fails by default or error if they exist. |
... |
additional arguments to |
If you wish to store non-vanilla R objects, such as those
containing external pointers to C structures, see
s3normalize
.
s3put
is equivalent to s3store
except that
it will fail by default if you try to overwrite an existing key.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Not run:
s3store(c(1,2,3), 'test123')
print(s3read('test123'))
# [1] 1 2 3
s3store(function(x, y) { x + 2 * y }, "myfunc")
stopifnot(s3read("myfunc")(1, 2) == 5) # R can serialize closures!
obj <- 1:5
s3store(obj) # If we do not pass a key the path is inferred from
# the expression using deparse(substitute(...)).
stopifnot(all.equal(s3read("obj"), 1:5))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.