as_nanoarrow_array {nanoarrow} | R Documentation |
Convert an object to a nanoarrow array
Description
In nanoarrow an 'array' refers to the struct ArrowArray
definition
in the Arrow C data interface. At the R level, we attach a
schema such that functionally the nanoarrow_array
class can be used in a similar way as an arrow::Array
. Note that in
nanoarrow an arrow::RecordBatch
and a non-nullable arrow::StructArray
are represented identically.
Usage
as_nanoarrow_array(x, ..., schema = NULL)
Arguments
x |
An object to convert to a array |
... |
Passed to S3 methods |
schema |
An optional schema used to enforce conversion to a particular
type. Defaults to |
Value
An object of class 'nanoarrow_array'
Examples
(array <- as_nanoarrow_array(1:5))
as.vector(array)
(array <- as_nanoarrow_array(data.frame(x = 1:5)))
as.data.frame(array)
[Package nanoarrow version 0.5.0.1 Index]