Learn R Programming

scidb (version 1.1-2)

persist: persist

Description

Mark a scidb or scidbdf object and any SciDB arrays in its dependency graph persistent.

Usage

persist(x, remove = FALSE, ...)

Arguments

x
A scidb or scidbdf object
remove
A logical value. See details.
...
Optional arguments not used by the default method, but reserved for future use.

Value

  • NULL is invisibly returned. Use this function for its side effects.

Details

Most scidb objects are ephemeral unless the gc=FALSE option is explicitly selected. Use the persist function with remove=FALSE to mark an array and all of its dependencies persistent. This is useful when you want to save a scidb object to an R data file and make sure its data is there when re-loaded.

Specify remove=TRUE to 'unpersist' an object and all of its dependencies.

See Also

scidb

Examples

Run this code
x <- as.scidb(iris)
y <- unique(x$Species)
persist(y)
save(y, file="y.rdata")

# Now, *both* x and y can be removed without deleting the backing SciDB
# array. Without persist or setting gc=FALSE on x, the array would have
# been removed.
rm(x,y)
gc()

# Since the array is still there, we can get it back.
load("y.rdata")
y[]

Run the code above in your browser using DataLab