jimhester / rarrow

R bindings to apache arrow
32 stars 1 forks source link

arrow

The goal of arrow is to have R bindings to apache arrow. This is just a proof of concept right now.

Installation

Arrow

Travis build status AppVeyor build status

First install a release build of the C++ bindings to arrow.

git clone https://github.com/apache/arrow.git
cd arrow/cpp && mkdir release && cd release

# It is important to statically link to boost libraries
cmake .. -DCMAKE_BUILD_TYPE=Release -DARROW_BOOST_USE_SHARED:BOOL=Off
make install

Example

library(arrow)
# Default print method calls the ToString method on the arrow array
arrow_array(c(1:5, NA, 6:10))
#> [1, 2, 3, 4, 5, null, 6, 7, 8, 9, 10]

# to_r converts the arrow array to an R vector
x <- arrow_array(c(1:5, NA, 6:25))
to_r(x)
#>  [1]  1  2  3  4  5 NA  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22
#> [24] 23 24 25