s3read: Read an R object in S3 by key

Description Usage Arguments Details See Also Examples

View source: R/s3read.r

Description

Any type of object that can be serialized as an RDS file is capable of being read using this interface.

Usage

1
s3read(name, path = s3path(), cache = TRUE, serialize = TRUE, ...)

Arguments

name

character. The key to grab from S3.

path

character. The location of your S3 bucket as a prefix to name, for example, "s3://mybucket/" or "s3://mybucket/myprefix/".

cache

logical. If true, use the local s3cache if available. If false, do not use cache. By default, TRUE. Note this will consume local disk space for objects that have been s3read.

serialize

logical. If true, use s3normalize to serialize the model object.

...

Can be used internally to pass more arguments to s3.get.

Details

If you wish to read non-vanilla R objects, such as those containing external pointers to C structures, see s3normalize.

See Also

s3store

Examples

1
2
3
4
5
6
7
8
9
## 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!

## End(Not run)

robertzk/s3mpi documentation built on May 27, 2019, 11:37 a.m.