R integration with Apache Arrow.
You first need to install the C++ library:
On macOS, you may install using homebrew:
brew install apache-arrow
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 .. -DARROW_PARQUET=ON -DCMAKE_BUILD_TYPE=Release -DARROW_BOOST_USE_SHARED:BOOL=Off
make install
library("devtools")
devtools::install_github("apache/arrow/r")
library(arrow)
#>
#> Attaching package: 'arrow'
#> The following object is masked from 'package:utils':
#>
#> timestamp
#> The following objects are masked from 'package:base':
#>
#> array, table
(tib <- tibble::tibble(x = 1:10, y = rnorm(10)))
#> # A tibble: 10 x 2
#> x y
#> <int> <dbl>
#> 1 1 -1.59
#> 2 2 1.31
#> 3 3 -0.513
#> 4 4 2.64
#> 5 5 0.389
#> 6 6 0.660
#> 7 7 1.66
#> 8 8 -0.120
#> 9 9 2.43
#> 10 10 1.53
tab <- table(tib)
tab$schema
#> arrow::Schema
#> x: int32
#> y: double
tab
#> arrow::Table
as_tibble(tab)
#> # A tibble: 10 x 2
#> x y
#> <int> <dbl>
#> 1 1 -1.59
#> 2 2 1.31
#> 3 3 -0.513
#> 4 4 2.64
#> 5 5 0.389
#> 6 6 0.660
#> 7 7 1.66
#> 8 8 -0.120
#> 9 9 2.43
#> 10 10 1.53
The arrow package is using devtools for package related manipulations. To install:
library.packages("devtools")
Within a local clone, one can test changes by running the test suite.
library("devtools")
devtools::install_dev_deps()
devtools::test()
R CMD build --keep-empty-dirs .
R CMD check arrow_*.tar.gz --as-cran --no-manual