cache: Upload an R Value to an Object Store

Description Usage Arguments Value Note See Also Examples

Description

Upload the R value to the object store connection con with the key name and optional path specified by key.

Usage

1
cache(con, value, key, xdr = FALSE)

Arguments

con

An object store connection from register_service.

value

Any serializeable R value.

key

A key name, optionally including a / separated directory path

xdr

set xdr=TRUE to use big-endian binary format, defaults to native binary

Value

A character string corresponding to the url of the uploaded object.

Note

Key names are url-encoded and may be changed (cache returns the uri of the stored value). The forward slash character / is NOT url-encoded and reserved for directory path information. Do not use any slash (forward or backward) in your key names, they will be interpreted as directory separators.

See Also

register_service uncache delete

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Start an example local mongoose backend server
mongoose_start()
con <- register_service()
# Cache the 'iris' dataset in a directory named 'mydata':
cache(con, iris, "mydata/iris")
# Retrieve it from the cache into a new variable called 'x'
x <- uncache(con, "mydata/iris")
# Delete the entire 'mydata' directory
delete(con, "mydata")
mongoose_stop()

bwlewis/feathercache documentation built on May 13, 2019, 9:06 a.m.