Description Usage Arguments Details Value Author(s) See Also Examples
Serialization interface to read/write R objects to S3
1 2 3 4 5 6 7 8 9 | s3saveRDS(
x,
object = paste0(as.character(substitute(x)), ".rds"),
bucket,
compress = TRUE,
...
)
s3readRDS(object, bucket, ...)
|
x |
For |
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”. |
compress |
A logical. See |
... |
Additional arguments passed to |
Note that early versions of s3saveRDS
from aws.s3 <= 0.2.4 unintentionally serialized objects to big endian format (due to defaults in serialize
. This can create problems when attempting to read these files using readRDS
. The function attempts to catch the issue and read accordingly, but may fail. The solution used internally is unserialize(memDecompress(get_object(), "gzip"))
For s3saveRDS
, a logical. For s3readRDS
, an R object.
Steven Akins <skawesome@gmail.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## Not run:
# create bucket
b <- put_bucket("myexamplebucket")
# save a single object to s3
s3saveRDS(x = mtcars, bucket = "myexamplebucket", object = "mtcars.rds")
# restore it under a different name
mtcars2 <- s3readRDS(object = "mtcars.rds", bucket = "myexamplebucket")
identical(mtcars, mtcars2)
# cleanup
delete_object(object = "mtcars.rds", bucket = "myexamplebucket")
delete_bucket("myexamplebucket")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.