Download SciDB data to R
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:
double -> double
int64 -> integer64
uint64 -> double
uint32 -> double
int32 -> integer
int16 -> integer
unit16 -> integer
int8 -> integer
uint8 -> integer
bool -> logical
string -> character
char -> character
binary -> raw
datetime -> Date
Examples
if (FALSE) { # \dontrun{
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
} # }