as.R: Download SciDB data to R

Description Usage Arguments Value Note See Also Examples

View source: R/utility.R

Description

Download SciDB data to R

Usage

1
as.R(x, only_attributes = FALSE, binary = TRUE)

Arguments

x

a scidb object (a SciDB array or expression)

only_attributes

optional logical argument, if TRUE do not download SciDB dimensions (see note)

binary

optional logical value, set to FALSE to download data using text format (useful for some unsupported SciDB types)

Value

An R data.frame

Note

This convenience function is equivalent to running iquery(db, x, return=TRUE) for a SciDB connection object db.

The only_attributes=TRUE option only works with binary transfers, and if specified will set binary=TRUE. Beware of the only_attributes=TRUE setting–SciDB may return data in arbitrary order.

SciDB values are always returned as R data frames. SciDB scalar types are converted to corresponding R types as follows:

See Also

as.scidb

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 
db <- scidbconnect()
x <- scidb(db, "build(<v:double>[i=1:5], sin(i))")
as.R(x)
## i          v
## 1  0.8414710
## 2  0.9092974
## 3  0.1411200
## 4 -0.7568025
## 5 -0.9589243

as.R(x, only_attributes=TRUE)
##          v
##  0.8414710
##  0.9092974
##  0.1411200
## -0.7568025
## -0.9589243

## End(Not run)

Paradigm4/SciDBR documentation built on May 13, 2018, 7:34 p.m.