s3save: save/load

Description Usage Arguments Value References See Also Examples

View source: R/s3save.R

Description

Save/load R object(s) to/from S3

Usage

1
2
3
4
5
s3save(..., object, bucket, envir = parent.frame(), opts = NULL)

s3save_image(object, bucket, opts = NULL)

s3load(object, bucket, envir = parent.frame(), ...)

Arguments

...

For s3save, one or more R objects to be saved via save and uploaded to S3. For s3load, see opts.

object

For s3save, a character string of the name of the object you want to save to. For s3load, a character string of the name of the object you want to load from S3.

bucket

Character string with the name of the bucket, or an object of class “s3_bucket”.

envir

For s3save, an R environment to save objects from; for s3load, the environment to load objects into. Default is the parent.frame() from which the function is called.

opts

Additional arguments passed to s3HTTP.

Value

For s3save, a logical, invisibly. For s3load, NULL invisibly.

References

API Documentation

See Also

s3saveRDS,s3readRDS

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Not run: 
# create bucket
b <- put_bucket("myexamplebucket")

# save a dataset to the bucket
s3save(mtcars, iris, object = "somedata.Rdata", bucket = b)
get_bucket(b)

# load the data from bucket
e <- new.env()
s3load(object = "somedata.Rdata", bucket = b, envir = e)
ls(e)

# cleanup
rm(e)
delete_object(object = "somedata.Rdata", bucket = "myexamplebucket")
delete_bucket("myexamplebucket")

## End(Not run)

cloudyr/aws.s3 documentation built on May 29, 2020, 7:18 p.m.