Title: | Connect nanoarrow with (Rcpp)Armadillo |
---|---|
Description: | The nanoarrow package offers C-level functionality to work with Arrow object, along with a small amount of C++ integration. This package uses it to interact with Armadillo objects. Some auxiliary testing facility from the nanoarrow package is included here as well. |
Authors: | Dirk Eddelbuettel |
Maintainer: | Dirk Eddelbuettel <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.0.1 |
Built: | 2024-12-28 16:21:46 UTC |
Source: | https://github.com/eddelbuettel/naarma |
Given a (nano)arrow object via two pointers, and a column size, return an arma matrix
armaMatrixExample(vec, ncol, verbose = FALSE)
armaMatrixExample(vec, ncol, verbose = FALSE)
vec |
A nanoarrow object |
ncol |
Number of columns in returned matrix |
verbose |
A logical value, default is false |
As this aims at armadillo operations, this functionality is limited to numeric vector columns. The framework used here could of course be extended to other Arrow formats.
sv <- nanoarrow::as_nanoarrow_array(c(4:8), nanoarrow::na_int16()) # internally int16 armaMatrixExample(sv, 2)
sv <- nanoarrow::as_nanoarrow_array(c(4:8), nanoarrow::na_int16()) # internally int16 armaMatrixExample(sv, 2)
Given a (nano)arrow array external pointer object via two pointers (with the second tucked away as the tag), return an arma vector
armaVectorExample(vec, verbose = FALSE)
armaVectorExample(vec, verbose = FALSE)
vec |
A nanoarrow array object as an external pointer |
verbose |
A logical value, default is false |
As this aims at armadillo interoperation, this functionality is limited to numeric vector columns. The framework used here could of course be extended to other Arrow formats.
sv <- nanoarrow::as_nanoarrow_array(c(4:7), nanoarrow::na_int16()) # internally int16 armaVectorExample(sv)
sv <- nanoarrow::as_nanoarrow_array(c(4:7), nanoarrow::na_int16()) # internally int16 armaVectorExample(sv)
Given a (nano)arrow stream object pointer, return an arma matrix
collectMatrixFromStream(obj, verbose = FALSE)
collectMatrixFromStream(obj, verbose = FALSE)
obj |
A nanoarrow array stream object via an external pointer |
verbose |
A logical value, default is false |
As this aims at armadillo operation, the returned matrix is always double while supported many possible column types.