Package 'naarma'

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

Help Index


Given a (nano)arrow object via two pointers, and a column size, return an arma matrix

Description

Given a (nano)arrow object via two pointers, and a column size, return an arma matrix

Usage

armaMatrixExample(vec, ncol, verbose = FALSE)

Arguments

vec

A nanoarrow object

ncol

Number of columns in returned matrix

verbose

A logical value, default is false

Limitations

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.

Examples

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

Description

Given a (nano)arrow array external pointer object via two pointers (with the second tucked away as the tag), return an arma vector

Usage

armaVectorExample(vec, verbose = FALSE)

Arguments

vec

A nanoarrow array object as an external pointer

verbose

A logical value, default is false

Limitations

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.

Examples

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

Description

Given a (nano)arrow stream object pointer, return an arma matrix

Usage

collectMatrixFromStream(obj, verbose = FALSE)

Arguments

obj

A nanoarrow array stream object via an external pointer

verbose

A logical value, default is false

Limitations

As this aims at armadillo operation, the returned matrix is always double while supported many possible column types.