| --- |
| output: github_document |
| --- |
| |
| <!-- README.md is generated from README.Rmd. Please edit that file --> |
| |
| ```{r setup, include = FALSE} |
| knitr::opts_chunk$set( |
| collapse = TRUE, |
| comment = "#>", |
| fig.path = "man/figures/README-", |
| out.width = "100%" |
| ) |
| ``` |
| # arrow |
| |
| R integration with Apache Arrow. |
| |
| ## Installation |
| |
| First install a release build of the C++ bindings to arrow. |
| |
| ```shell |
| 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 |
| ``` |
| |
| Then the R package: |
| |
| ```r |
| devtools::install_github("apache/arrow/r") |
| ``` |
| |
| ## Example |
| |
| ```{r} |
| library(arrow, warn.conflicts = FALSE) |
| library(tibble) |
| library(reticulate) |
| |
| tf <- tempfile() |
| |
| # write arrow::Table to file |
| (tib <- tibble(x = 1:10, y = rnorm(10))) |
| arrow::write_arrow(tib, tf) |
| |
| # read it back with pyarrow |
| pa <- import("pyarrow") |
| as_tibble(pa$open_file(tf)$read_pandas()) |
| ``` |