Learn R Programming

scidb (version 1.2-0)

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

Description

Upload an R vector, matrix or data.frame into SciDB, returning a reference scidb object.

Usage

as.scidb(X, name = tmpnam(), chunksize, overlap, start, chunkSize, gc=TRUE, ...)

Arguments

X
A vector, matrix or sparse matrix of double-precision floating point values or a data.frame.
name
The name of the SciDB array to create.
chunksize
A vector of optional SciDB array chunk sizes (a vector of length 1 for data frames and vectors, length 2 for matrices)
overlap
(Not yet supported)
start
A vector of SciDB array starting dimension numeric index value or values.
chunkSize
(Same as chunksize argument, for backwards compatibility -- use chunksize instead)
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

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. Data are transferred using a binary representation.

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. A utitlity function called df2scidb is used for data.frame uploads--the functions as.scidb and df2scidb are equivalent in this use case. Note that data frame data are transferred using a text representation.

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

See Also

scidb df2scidb

Examples

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

Run the code above in your browser using DataLab