Learn R Programming

scidb (version 1.0-1)

as.scidb: Upload an R matrix or data.frame to a SciDB array.

Description

Cast an R matrix or data.frame to a SciDB array, returning a reference scidb object.

Usage

as.scidb(X, name = ifelse(exists(as.character(match.call()[2])), as.character(match.call()[2]), tmpnam("array")), rowChunkSize = 1000L, colChunkSize = 1000L, start = c(0L,0L), gc=FALSE, ...)

Arguments

X
A matrix of double-precision floating point values or a data.frame.
name
The name of the SciDB array to create, defaulting to the R variable name if available.
rowChunkSize
Maximum SciDB chunk size for the 1st array dimension.
colChunkSize
Maximum SciDB chunk size for the 2nd array dimension (ignored for vectors and data.frames).
start
Starting dimension numeric index value or values.
gc
Set to TRUE to remove SciDB array when R object is garbage collected or R exists. FALSE means SciDB array persists.
...
additional arguments to pass to df2scidb (see df2scidb).

Value

  • A scidb reference object.

Details

Used with a matrix or vector argument, the as.scidb function creates a single-attribute SciDB array named name and copies the data from X into it, returning a scidb object reference to the new array. The SciDB array will be 1-D if X is a vector, and 2-D if X is a matrix.

If X is a data.frame, then as.scidb creates a one-dimensional multi-attribute SciDB array, with SciDB attributes representing each column of the data.frame. The functions as.scidb and {df2scidb} are equivalent in this use case.

The SciDB array row and column chunk sizes are set to the minimum of the number of rows and columns of X and the specified rowChunkSize and colChunkSize arguments, respectively. The column chunk size argument is ignored if the X is a vector.

This function supports double-precision, integer (32-bit), logical, and single-character array attribute types.

See Also

scidb df2scidb

Examples

Run this code
X <- matrix(runif(20),5)
A <- as.scidb(X)
as.scidb(iris)
scidblist()
print(A)

Run the code above in your browser using DataLab