You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by we...@apache.org on 2018/09/25 21:43:50 UTC

[arrow] branch master updated: ARROW-3282: [R] initial R functionality

This is an automated email from the ASF dual-hosted git repository.

wesm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new ea8940a  ARROW-3282: [R] initial R functionality
ea8940a is described below

commit ea8940ae8d524b0625bdce194b141315bfa260ea
Author: Romain Francois <ro...@purrple.cat>
AuthorDate: Tue Sep 25 17:41:37 2018 -0400

    ARROW-3282: [R] initial R functionality
    
    * Wrapping C++ pointers to arrow objects as R6 classes holding an R external pointer.
    * Factory functions for the metadata types, int32(), ...
    * Factory to create schemas and struct
    * Create Array, RecordBatch, Table from R vectors and data frames. initially only support integer (int32), numeric (float64) and raw (int8) vectors.
    * Reading and Writing record batches and Table to files.
    
    Author: Romain Francois <ro...@purrple.cat>
    
    Closes #2596 from romainfrancois/r-dev-buffer and squashes the following commits:
    
    9ab188206 <Romain Francois> mark Roxygen and Rcpp generated files
    661f37029 <Romain Francois> Using FirstTimeBitmapWriter instead of BitmapWriter.
    e81b72b40 <Romain Francois> only set null_bitmap if null_count > 0
    bfe853d93 <Romain Francois> using 0-based indices in the tests.
    b39155664 <Romain Francois> Also use arrow::internak::BitmapWriter
    9e6055519 <Romain Francois> name fixes. Using __ consistently
    bf814bb64 <Romain Francois> Using arrow::internal::BitmapReader
    c8aa70393 <Romain Francois> Also use std::shared_ptr for MemoryPool.
    2aa8a5f91 <Romain Francois> need dev version of `vctrs`
    394bd330d <Romain Francois> :rat: + RecordBatch$Slice
    de93a4f23 <Romain Francois> RecordBatch tests
    9d208a4a3 <Romain Francois> +Array$RangeEquals
    f8600635b <Romain Francois> Move each class to their own file
    a89a9a8ef <Romain Francois> Move RecordBatch impl to own file
    a2f9f5150 <Romain Francois> correctly handling offset()
    8263c0d22 <Romain Francois> + tests for ChunkedArray
    e02e24f76 <Romain Francois> +chunked_array and tests
    b20e4b09d <Romain Francois> More tests
    d11cda031 <Romain Francois> +R6 class ChunkedArray
    29af2ea96 <Romain Francois> license headers
    2f53ebf0d <Romain Francois> Additional tests for read_arrow / write_arrow
    4237c3264 <Romain Francois> Clear the bit for non NA.
    ede8e4460 <Romain Francois> Handle null buffer in R <-> Array conversions
    a5b8190b0 <Romain Francois> update README with example of reading/writing arrow::Table
    d951db8db <Romain Francois> "documentation" to quiet check()
    908c2accb <Romain Francois> read_arrow and write_arrow now relate to arrow::Table.
    110b00d24 <Romain Francois> resolving conflicts
    ae55f8b6e <Romain Francois> ..
    767e9d9e1 <Romain Francois> more generic print method
    8d8cdd1ce <Romain Francois> + read_arrow / write_arrow for now
    c1385a0e3 <Romain Francois> export Array_as_vector, +Array$ToString
    23fbd0162 <Romain Francois> + column names
    97659ffca <Romain Francois> + as_tibble.arrow::RecordBatch
    fa4ee2212 <Romain Francois> + read_record_batch
    f27eebafa <Romain Francois> - MakeArray
    4977bb2d7 <Romain Francois> no need to make ArrayData directly
    ef7cda147 <Romain Francois> class constructors only take the external pointers, logic moved to factory functions
    81e059ae7 <Romain Francois> rebasing
    421e471ab <Romain Francois> +macro R_ERROR_NOT_OK similar to RETURN_NOT_OK but that Rcpp::stop()s
    f5e3eff49 <Romain Francois> attempt RecordBatch$to_file
    79205fbaa <Romain Francois> initial stab at arrow::table(data.frame)
    f6f1775bc <Romain Francois> s/data/.data/
    b9c215b4e <Romain Francois> "document" array and record_batch
    edf609820 <Romain Francois> Need to install `vctrs` from github for now
    6aecdce74 <Romain Francois> skip using rpath linker option
    b8dac548f <Romain Francois> +RecordBatch$schema
    1fc3cc2f8 <Romain Francois> no longer need this
    05da931f7 <Romain Francois> initial stab at record_batch
    f4d0a3417 <Romain Francois> must include arrow_types.h first
    aee2d0aa0 <Romain Francois> initial stab at arrow::array
    a6ae2f383 <Romain Francois> cleanup
    e14b5468d <Romain Francois> follow up from @wesm comments on #2489
    36e9801f4 <Romain Francois> + installation instructions
    108caf993 <Romain Francois> not checking for headers on these files
    b829bdfa0 <Romain Francois> initial R :package: with travis setup and testthat suite, that links to arrow c++ library and calls arrow::int32()
    26e712d52 <Romain Francois> Initial work for type metadata, with tests.
    e2512990c <Romain Francois> + installation instructions
    a9a8bbb7a <Romain Francois> not checking for headers on these files
    e0a7eff78 <Romain Francois> initial R :package: with travis setup and testthat suite, that links to arrow c++ library and calls arrow::int32()
    b1c1109b0 <Romain Francois> finished rebasing after initial R patch merged
    887df48f4 <Romain Francois> skip using rpath linker option
    a6de97501 <Romain Francois> cleanup
    8526e5118 <Romain Francois> follow up from @wesm comments on #2489
    f03a27729 <Romain Francois> + installation instructions
    0995ca44c <Romain Francois> not checking for headers on these files
    1cb547e7e <Romain Francois> initial R :package: with travis setup and testthat suite, that links to arrow c++ library and calls arrow::int32()
    705c12540 <Romain Francois> exclude Rd files :rat:
    605e3021d <Romain Francois> time32 only handles second and millisecond time64 only handles microsecond and nanosecond
    afdbae6b8 <Romain Francois> + licence header for R6.R file
    65563f534 <Romain Francois> minimal documentation for check()
    b7135c7dc <Romain Francois> stop exporting everything
    6aaf19298 <Romain Francois> ignoring the .clang-format file
    d854f2f40 <Romain Francois> + license headers for R files :speak_no_evil:
    d992b266e <Romain Francois> Initial work for type metadata, with tests.
    614dd0735 <Romain Francois> + installation instructions
    afce06ae5 <Romain Francois> initial R :package: with travis setup and testthat suite, that links to arrow c++ library and calls arrow::int32()
---
 .gitattributes                                     |    4 +
 .gitignore                                         |    2 +
 dev/release/rat_exclude_files.txt                  |    2 +
 r/.Rbuildignore                                    |    3 +
 r/DESCRIPTION                                      |   42 +-
 r/NAMESPACE                                        |   57 +
 .gitignore => r/R/ArrayData.R                      |   33 +-
 r/R/ChunkedArray.R                                 |   46 +
 .gitignore => r/R/Column.R                         |   32 +-
 .gitignore => r/R/Field.R                          |   53 +-
 r/{tests/testthat/test-arrow.R => R/List.R}        |   12 +-
 r/R/R6.R                                           |  326 +++++
 r/R/RcppExports.R                                  |  420 ++++++-
 r/R/RecordBatch.R                                  |   72 ++
 .gitignore => r/R/Schema.R                         |   34 +-
 r/{tests/testthat.R => R/Struct.R}                 |   13 +-
 r/R/Table.R                                        |   67 ++
 r/R/array.R                                        |   62 +
 r/R/enums.R                                        |   63 +
 .gitignore => r/R/memory_pool.R                    |   36 +-
 .../testthat/test-arrow.R => R/reexports-tibble.R} |    8 +-
 r/README.Rmd                                       |   18 +-
 r/README.md                                        |   42 +-
 r/data-raw/test.R                                  |   85 ++
 r/man/DataType.Rd                                  |  106 ++
 r/man/array.Rd                                     |   14 +
 r/man/chunked_array.Rd                             |   14 +
 r/man/read_arrow.Rd                                |   17 +
 r/man/record_batch.Rd                              |   14 +
 r/man/reexports.Rd                                 |   16 +
 r/man/table.Rd                                     |   14 +
 r/man/write_arrow.Rd                               |   16 +
 r/{tests/testthat.R => src/.clang-format}          |    9 +-
 r/src/{r_arrow_types.h => ArrayData.cpp}           |   26 +-
 r/src/ChunkedArray.cpp                             |  123 ++
 r/src/{hello.cpp => Column.cpp}                    |   22 +-
 r/src/DataType.cpp                                 |  212 ++++
 r/src/Makevars.in                                  |    2 +-
 r/src/{hello.cpp => MemoryPool.cpp}                |   19 +-
 r/src/RcppExports.cpp                              | 1273 +++++++++++++++++++-
 r/src/RecordBatch.cpp                              |  145 +++
 r/src/Table.cpp                                    |  106 ++
 r/src/array.cpp                                    |  238 ++++
 r/src/arrow_types.h                                |  106 ++
 r/src/{hello.cpp => field.cpp}                     |   26 +-
 r/tests/testthat.R                                 |    1 +
 r/tests/testthat/test-Array.R                      |   66 +
 r/tests/testthat/test-DataType.R                   |  314 +++++
 r/tests/testthat/test-RecordBatch.R                |   59 +
 r/tests/testthat/test-chunkedarray.R               |   77 ++
 r/tests/testthat/test-read-write.R                 |  126 ++
 51 files changed, 4527 insertions(+), 166 deletions(-)

diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..4a9f90a
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,4 @@
+r/R/RcppExports.R linguist-generated=true
+r/src/RcppExports.cpp linguist-generated=true
+r/man/*.Rd linguist-generated=true
+
diff --git a/.gitignore b/.gitignore
index 2a19b34..1493582 100644
--- a/.gitignore
+++ b/.gitignore
@@ -39,3 +39,5 @@ python/.eggs/
 .pytest_cache/
 pkgs
 .Rproj.user
+arrow.Rcheck/
+
diff --git a/dev/release/rat_exclude_files.txt b/dev/release/rat_exclude_files.txt
index e5f25e6..7bdef5d 100644
--- a/dev/release/rat_exclude_files.txt
+++ b/dev/release/rat_exclude_files.txt
@@ -127,3 +127,5 @@ r/.Rbuildignore
 r/arrow.Rproj
 r/README.md
 r/README.Rmd
+r/man/*.Rd
+.gitattributes
diff --git a/r/.Rbuildignore b/r/.Rbuildignore
index 931662b..89f34ae 100644
--- a/r/.Rbuildignore
+++ b/r/.Rbuildignore
@@ -1,3 +1,6 @@
 ^.*\.Rproj$
 ^\.Rproj\.user$
 ^README\.Rmd$
+src/.clang-format
+LICENSE.md
+^data-raw$
diff --git a/r/DESCRIPTION b/r/DESCRIPTION
index db9652e..bf76b72 100644
--- a/r/DESCRIPTION
+++ b/r/DESCRIPTION
@@ -2,7 +2,7 @@ Package: arrow
 Title: R Integration to 'Apache' 'Arrow'
 Version: 0.0.0.9000
 Authors@R: c(
-    person("Romain", "François", email = "romain@rstudio.com", role = c("aut", "cre")), 
+    person("Romain", "François", email = "romain@rstudio.com", role = c("aut", "cre")),
     person("Apache Arrow", email = "dev@arrow.apache.org", role = c("aut", "cph"))
   )
 Description: R Integration to 'Apache' 'Arrow'.
@@ -11,11 +11,39 @@ License: Apache License (>= 2.0)
 Encoding: UTF-8
 LazyData: true
 SystemRequirements: C++11
-LinkingTo: 
-    Rcpp
-Imports: 
-    Rcpp
+LinkingTo:
+    Rcpp (>= 0.12.18)
+Imports:
+    Rcpp (>= 0.12.18),
+    rlang,
+    purrr,
+    assertthat,
+    glue,
+    R6,
+    vctrs,
+    fs,
+    tibble,
+    crayon
+Remotes:
+    r-lib/vctrs
 Roxygen: list(markdown = TRUE)
-RoxygenNote: 6.0.1.9000
-Suggests: 
+RoxygenNote: 6.1.0.9000
+Suggests:
     testthat
+Collate:
+    'enums.R'
+    'R6.R'
+    'ArrayData.R'
+    'ChunkedArray.R'
+    'Column.R'
+    'Field.R'
+    'List.R'
+    'RcppExports.R'
+    'RecordBatch.R'
+    'Schema.R'
+    'Struct.R'
+    'Table.R'
+    'array.R'
+    'memory_pool.R'
+    'reexports-tibble.R'
+    'zzz.R'
diff --git a/r/NAMESPACE b/r/NAMESPACE
index 4bd43f4..d8dfecd 100644
--- a/r/NAMESPACE
+++ b/r/NAMESPACE
@@ -1,4 +1,61 @@
 # Generated by roxygen2: do not edit by hand
 
+S3method("!=","arrow::Object")
+S3method("$","arrow-enum")
+S3method("==","arrow::Array")
+S3method("==","arrow::DataType")
+S3method("==","arrow::Field")
+S3method("==","arrow::RecordBatch")
+S3method(as_tibble,"arrow::RecordBatch")
+S3method(as_tibble,"arrow::Table")
+S3method(length,"arrow::Array")
+S3method(names,"arrow::RecordBatch")
+S3method(print,"arrow-enum")
+export(DateUnit)
+export(StatusCode)
+export(TimeUnit)
+export(Type)
+export(array)
+export(as_tibble)
+export(boolean)
+export(chunked_array)
+export(date32)
+export(date64)
+export(decimal)
+export(float16)
+export(float32)
+export(float64)
+export(int16)
+export(int32)
+export(int64)
+export(int8)
+export(list_of)
+export(null)
+export(read_arrow)
+export(record_batch)
+export(schema)
+export(struct)
+export(table)
+export(time32)
+export(time64)
+export(timestamp)
+export(uint16)
+export(uint32)
+export(uint64)
+export(uint8)
+export(utf8)
+export(write_arrow)
+importFrom(R6,R6Class)
 importFrom(Rcpp,sourceCpp)
+importFrom(assertthat,assert_that)
+importFrom(glue,glue)
+importFrom(purrr,map)
+importFrom(purrr,map2)
+importFrom(purrr,map_chr)
+importFrom(purrr,map_int)
+importFrom(rlang,dots_n)
+importFrom(rlang,quo_name)
+importFrom(rlang,seq2)
+importFrom(rlang,set_names)
+importFrom(tibble,as_tibble)
 useDynLib(arrow, .registration = TRUE)
diff --git a/.gitignore b/r/R/ArrayData.R
similarity index 68%
copy from .gitignore
copy to r/R/ArrayData.R
index 2a19b34..37802b2 100644
--- a/.gitignore
+++ b/r/R/ArrayData.R
@@ -15,27 +15,14 @@
 # specific language governing permissions and limitations
 # under the License.
 
-# Compiled source
-*.a
-*.dll
-*.o
-*.py[ocd]
-*.so
-*.so.*
-*.dylib
-.build_cache_dir
-MANIFEST
+#' @include R6.R
 
-# Generated Visual Studio files
-*.vcxproj
-*.vcxproj.*
-*.sln
-*.iml
-
-cpp/.idea/
-python/.eggs/
-.vscode
-.idea/
-.pytest_cache/
-pkgs
-.Rproj.user
+`arrow::ArrayData` <- R6Class("arrow::ArrayData",
+  inherit = `arrow::Object`,
+  active = list(
+    type = function() `arrow::DataType`$dispatch(ArrayData__get_type(self)),
+    length = function() ArrayData__get_length(self),
+    null_count = function() ArrayData__get_null_count(self),
+    offset = function() ArrayData__get_offset(self)
+  )
+)
diff --git a/r/R/ChunkedArray.R b/r/R/ChunkedArray.R
new file mode 100644
index 0000000..a93e7f8
--- /dev/null
+++ b/r/R/ChunkedArray.R
@@ -0,0 +1,46 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+#' @include R6.R
+
+`arrow::ChunkedArray` <- R6Class("arrow::ChunkedArray", inherit = `arrow::Object`,
+  public = list(
+    length = function() ChunkedArray__length(self),
+    null_count = function() ChunkedArray__null_count(self),
+    num_chunks = function() ChunkedArray__num_chunks(self),
+    chunk = function(i) `arrow::Array`$new(ChunkedArray__chunk(self, i)),
+    chunks = function() purrr::map(ChunkedArray__chunks(self), `arrow::Array`$new),
+    type = function() `arrow::DataType`$dispatch(ChunkedArray__type(self)),
+    as_vector = function() ChunkedArray__as_vector(self),
+    Slice = function(offset, length = NULL){
+      if (is.null(length)) {
+        `arrow::ChunkedArray`$new(ChunkArray__Slice1(self, offset))
+      } else {
+        `arrow::ChunkedArray`$new(ChunkArray__Slice2(self, offset, length))
+      }
+    }
+  )
+)
+
+#' create an arrow::Array from an R vector
+#'
+#' @param \dots Vectors to coerce
+#'
+#' @export
+chunked_array <- function(...){
+  `arrow::ChunkedArray`$new(ChunkedArray__from_list(rlang::list2(...)))
+}
diff --git a/.gitignore b/r/R/Column.R
similarity index 69%
copy from .gitignore
copy to r/R/Column.R
index 2a19b34..bab6f17 100644
--- a/.gitignore
+++ b/r/R/Column.R
@@ -15,27 +15,13 @@
 # specific language governing permissions and limitations
 # under the License.
 
-# Compiled source
-*.a
-*.dll
-*.o
-*.py[ocd]
-*.so
-*.so.*
-*.dylib
-.build_cache_dir
-MANIFEST
+#' @include R6.R
 
-# Generated Visual Studio files
-*.vcxproj
-*.vcxproj.*
-*.sln
-*.iml
-
-cpp/.idea/
-python/.eggs/
-.vscode
-.idea/
-.pytest_cache/
-pkgs
-.Rproj.user
+`arrow::Column` <- R6Class("arrow::Column", inherit = `arrow::Object`,
+  public = list(
+    length = function() Column__length(self),
+    null_count = function() Column__null_count(self),
+    type = function() `arrow::DataType`$dispatch(Column__type(self)),
+    data = function() `arrow::ChunkedArray`$new(Column__data(self))
+  )
+)
diff --git a/.gitignore b/r/R/Field.R
similarity index 54%
copy from .gitignore
copy to r/R/Field.R
index 2a19b34..e01eb1a 100644
--- a/.gitignore
+++ b/r/R/Field.R
@@ -15,27 +15,36 @@
 # specific language governing permissions and limitations
 # under the License.
 
-# Compiled source
-*.a
-*.dll
-*.o
-*.py[ocd]
-*.so
-*.so.*
-*.dylib
-.build_cache_dir
-MANIFEST
+#' @include R6.R
 
-# Generated Visual Studio files
-*.vcxproj
-*.vcxproj.*
-*.sln
-*.iml
+`arrow::Field` <- R6Class("arrow::Field",
+  inherit = `arrow::Object`,
+  public = list(
+    ToString = function() {
+      Field__ToString(self)
+    },
+    name = function() {
+      Field__name(self)
+    },
+    nullable = function() {
+      Field__nullable(self)
+    },
+    Equals = function(other) {
+      inherits(other, "arrow::Field") && Field__Equals(self, other)
+    }
+  )
+)
 
-cpp/.idea/
-python/.eggs/
-.vscode
-.idea/
-.pytest_cache/
-pkgs
-.Rproj.user
+#' @export
+`==.arrow::Field` <- function(lhs, rhs){
+  lhs$Equals(rhs)
+}
+
+field <- function(name, type) {
+  `arrow::Field`$new(Field__initialize(name, type))
+}
+
+.fields <- function(.list){
+  assert_that( !is.null(nms <- names(.list)) )
+  map2(nms, .list, field)
+}
diff --git a/r/tests/testthat/test-arrow.R b/r/R/List.R
similarity index 80%
copy from r/tests/testthat/test-arrow.R
copy to r/R/List.R
index f76d7ee..5360401 100644
--- a/r/tests/testthat/test-arrow.R
+++ b/r/R/List.R
@@ -15,8 +15,12 @@
 # specific language governing permissions and limitations
 # under the License.
 
-context("test-arrow.R")
+#' @include R6.R
 
-test_that("can use arrow C++ library", {
-  expect_equal(arrow:::ping_arrow(), "int32")
-})
+`arrow::ListType` <- R6Class("arrow::ListType",
+  inherit = `arrow::NestedType`
+)
+
+#' @rdname DataType
+#' @export
+list_of <- function(type) `arrow::ListType`$new(list__(type))
diff --git a/r/R/R6.R b/r/R/R6.R
new file mode 100644
index 0000000..80bdf8e
--- /dev/null
+++ b/r/R/R6.R
@@ -0,0 +1,326 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+#' @include enums.R
+#' @importFrom R6 R6Class
+#' @importFrom glue glue
+#' @importFrom purrr map map_int map2
+#' @importFrom rlang dots_n
+#' @importFrom assertthat assert_that
+
+`arrow::Object` <- R6Class("arrow::Object",
+  public = list(
+    initialize = function(xp) self$set_pointer(xp),
+
+    pointer = function() self$`.:xp:.`,
+    `.:xp:.` = NULL,
+    set_pointer = function(xp){
+      self$`.:xp:.` <- xp
+    },
+    print = function(...){
+      cat(crayon::silver(glue::glue("{cl} <{p}>", cl = class(self)[[1]], p = self$pointer_address())), "\n")
+      if(!is.null(self$ToString)){
+        cat(self$ToString(), "\n")
+      }
+      invisible(self)
+    },
+    pointer_address = function(){
+      Object__pointer_address(self$pointer())
+    }
+  )
+)
+
+#' @export
+`!=.arrow::Object` <- function(lhs, rhs){
+  !(lhs == rhs)
+}
+
+`arrow::DataType` <- R6Class("arrow::DataType",
+  inherit = `arrow::Object`,
+  public = list(
+    ToString = function() {
+      DataType__ToString(self)
+    },
+    name = function() {
+      DataType__name(self)
+    },
+    Equals = function(other) {
+      assert_that(inherits(other, "arrow::DataType"))
+      DataType__Equals(self, other)
+    },
+    num_children = function() {
+      DataType__num_children(self)
+    },
+    children = function() {
+      map(DataType__children_pointer(self), ~`arrow::Field`$new(xp=.x))
+    },
+    id = function(){
+      DataType__id(self)
+    },
+    ..dispatch = function(){
+      switch(names(Type)[self$id()+1],
+        "NA" = null(),
+        BOOL = boolean(),
+        UINT8 = uint8(),
+        INT8 = int8(),
+        UINT16 = uint16(),
+        INT16 = int16(),
+        UINT32 = uint32(),
+        INT32 = int32(),
+        UINT64 = uint64(),
+        INT64 = int64(),
+        HALF_FLOAT = float16(),
+        FLOAT = float32(),
+        DOUBLE = float64(),
+        STRING = utf8(),
+        BINARY = stop("Type BINARY not implemented yet"),
+        DATE32 = date32(),
+        DATE64 = date64(),
+        TIMESTAMP = `arrow::Timestamp`$new(self$pointer()),
+        INTERVAL = stop("Type INTERVAL not implemented yet"),
+        DECIMAL = `arrow::Decimal128Type`$new(self$pointer()),
+        LIST = `arrow::ListType`$new(self$pointer()),
+        STRUCT = `arrow::StructType`$new(self$pointer()),
+        UNION = stop("Type UNION not implemented yet"),
+        DICTIONARY = stop("Type DICTIONARY not implemented yet"),
+        MAP = stop("Type MAP not implemented yet")
+      )
+    }
+  )
+)
+
+`arrow::DataType`$dispatch <- function(xp){
+  `arrow::DataType`$new(xp)$..dispatch()
+}
+
+#----- metadata
+
+`arrow::FixedWidthType` <- R6Class("arrow::FixedWidthType",
+  inherit = `arrow::DataType`,
+  public = list(
+    bit_width = function() FixedWidthType__bit_width(self)
+  )
+)
+
+#' @export
+`==.arrow::DataType` <- function(lhs, rhs){
+  lhs$Equals(rhs)
+}
+
+"arrow::Int8"    <- R6Class("arrow::Int8",
+  inherit = `arrow::FixedWidthType`
+)
+
+"arrow::Int16"    <- R6Class("arrow::Int16",
+  inherit = `arrow::FixedWidthType`
+)
+
+"arrow::Int32"    <- R6Class("arrow::Int32",
+  inherit = `arrow::FixedWidthType`
+)
+
+"arrow::Int64"    <- R6Class("arrow::Int64",
+  inherit = `arrow::FixedWidthType`
+)
+
+
+"arrow::UInt8"    <- R6Class("arrow::UInt8",
+  inherit = `arrow::FixedWidthType`
+)
+
+"arrow::UInt16"    <- R6Class("arrow::UInt16",
+  inherit = `arrow::FixedWidthType`
+)
+
+"arrow::UInt32"    <- R6Class("arrow::UInt32",
+  inherit = `arrow::FixedWidthType`
+)
+
+"arrow::UInt64"    <- R6Class("arrow::UInt64",
+  inherit = `arrow::FixedWidthType`
+)
+
+"arrow::Float16"    <- R6Class("arrow::Float16",
+  inherit = `arrow::FixedWidthType`
+)
+"arrow::Float32"    <- R6Class("arrow::Float32",
+  inherit = `arrow::FixedWidthType`
+)
+"arrow::Float64"    <- R6Class("arrow::Float64",
+  inherit = `arrow::FixedWidthType`
+)
+
+"arrow::Boolean"    <- R6Class("arrow::Boolean",
+  inherit = `arrow::FixedWidthType`
+)
+
+"arrow::Utf8"    <- R6Class("arrow::Utf8",
+  inherit = `arrow::DataType`
+)
+
+`arrow::DateType` <- R6Class("arrow::DateType",
+  inherit = `arrow::FixedWidthType`,
+  public = list(
+    unit = function() DateType__unit(self)
+  )
+)
+
+"arrow::Date32"    <- R6Class("arrow::Date32",
+  inherit = `arrow::DateType`
+)
+"arrow::Date64"    <- R6Class("arrow::Date64",
+  inherit = `arrow::DateType`
+)
+
+"arrow::TimeType" <- R6Class("arrow::TimeType",
+  inherit = `arrow::FixedWidthType`,
+  public = list(
+    unit = function() TimeType__unit(self)
+  )
+)
+"arrow::Time32"    <- R6Class("arrow::Time32",
+  inherit = `arrow::TimeType`
+)
+"arrow::Time64"    <- R6Class("arrow::Time64",
+  inherit = `arrow::TimeType`
+)
+
+"arrow::Null" <- R6Class("arrow::Null",
+  inherit = `arrow::DataType`
+)
+
+`arrow::Timestamp` <- R6Class(
+  "arrow::Timestamp",
+  inherit = `arrow::FixedWidthType` ,
+  public = list(
+    timezone = function()  TimestampType__timezone(self),
+    unit = function() TimestampType__unit(self)
+  )
+)
+
+`arrow::DecimalType` <- R6Class("arrow:::DecimalType",
+  inherit = `arrow::FixedWidthType`,
+  public = list(
+    precision = function() DecimalType__precision(self),
+    scale = function() DecimalType__scale(self)
+  )
+)
+
+"arrow::Decimal128Type"    <- R6Class("arrow::Decimal128Type",
+  inherit = `arrow::DecimalType`
+)
+
+#' Apache Arrow data types
+#'
+#' Apache Arrow data types
+#'
+#' @param unit time unit
+#' @param timezone time zone
+#' @param precision precision
+#' @param scale scale
+#' @param type type
+#' @param ... ...
+#'
+#' @rdname DataType
+#' @export
+int8 <- function() `arrow::Int8`$new(Int8__initialize())
+
+#' @rdname DataType
+#' @export
+int16 <- function() `arrow::Int16`$new(Int16__initialize())
+
+#' @rdname DataType
+#' @export
+int32 <- function() `arrow::Int32`$new(Int32__initialize())
+
+#' @rdname DataType
+#' @export
+int64 <- function() `arrow::Int64`$new(Int64__initialize())
+
+#' @rdname DataType
+#' @export
+uint8 <- function() `arrow::UInt8`$new(UInt8__initialize())
+
+#' @rdname DataType
+#' @export
+uint16 <- function() `arrow::UInt16`$new(UInt16__initialize())
+
+#' @rdname DataType
+#' @export
+uint32 <- function() `arrow::UInt32`$new(UInt32__initialize())
+
+#' @rdname DataType
+#' @export
+uint64 <- function() `arrow::UInt64`$new(UInt64__initialize())
+
+#' @rdname DataType
+#' @export
+float16 <- function() `arrow::Float16`$new(Float16__initialize())
+
+#' @rdname DataType
+#' @export
+float32 <- function() `arrow::Float32`$new(Float32__initialize())
+
+#' @rdname DataType
+#' @export
+float64 <- function() `arrow::Float64`$new(Float64__initialize())
+
+#' @rdname DataType
+#' @export
+boolean <- function() `arrow::Boolean`$new(Boolean__initialize())
+
+#' @rdname DataType
+#' @export
+utf8 <- function() `arrow::Utf8`$new(Utf8__initialize())
+
+#' @rdname DataType
+#' @export
+date32 <- function() `arrow::Date32`$new(Date32__initialize())
+
+#' @rdname DataType
+#' @export
+date64 <- function() `arrow::Date64`$new(Date64__initialize())
+
+#' @rdname DataType
+#' @export
+time32 <- function(unit) {
+  `arrow::Time32`$new(Time32__initialize(unit))
+}
+
+#' @rdname DataType
+#' @export
+time64 <- function(unit) `arrow::Time64`$new(Time64__initialize(unit))
+
+#' @rdname DataType
+#' @export
+null <- function() `arrow::Null`$new(Null__initialize())
+
+#' @rdname DataType
+#' @export
+timestamp <- function(unit, timezone) {
+  if (missing(timezone)) {
+    `arrow::Timestamp`$new(Timestamp__initialize1(unit))
+  } else {
+    `arrow::Timestamp`$new(Timestamp__initialize2(unit, timezone))
+  }
+}
+
+#' @rdname DataType
+#' @export
+decimal <- function(precision, scale) `arrow::Decimal128Type`$new(Decimal128Type__initialize(precision, scale))
+
+`arrow::NestedType` <- R6Class("arrow::NestedType", inherit = `arrow::DataType`)
diff --git a/r/R/RcppExports.R b/r/R/RcppExports.R
index 1439551..c70a515 100644
--- a/r/R/RcppExports.R
+++ b/r/R/RcppExports.R
@@ -1,7 +1,423 @@
 # Generated by using Rcpp::compileAttributes() -> do not edit by hand
 # Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
 
-ping_arrow <- function() {
-    .Call(`_arrow_ping_arrow`)
+Array__from_vector <- function(x) {
+    .Call(`_arrow_Array__from_vector`, x)
+}
+
+Array__as_vector <- function(array) {
+    .Call(`_arrow_Array__as_vector`, array)
+}
+
+Array__Slice1 <- function(array, offset) {
+    .Call(`_arrow_Array__Slice1`, array, offset)
+}
+
+Array__Slice2 <- function(array, offset, length) {
+    .Call(`_arrow_Array__Slice2`, array, offset, length)
+}
+
+Array__IsNull <- function(x, i) {
+    .Call(`_arrow_Array__IsNull`, x, i)
+}
+
+Array__IsValid <- function(x, i) {
+    .Call(`_arrow_Array__IsValid`, x, i)
+}
+
+Array__length <- function(x) {
+    .Call(`_arrow_Array__length`, x)
+}
+
+Array__offset <- function(x) {
+    .Call(`_arrow_Array__offset`, x)
+}
+
+Array__null_count <- function(x) {
+    .Call(`_arrow_Array__null_count`, x)
+}
+
+Array__type <- function(x) {
+    .Call(`_arrow_Array__type`, x)
+}
+
+Array__ToString <- function(x) {
+    .Call(`_arrow_Array__ToString`, x)
+}
+
+Array__type_id <- function(x) {
+    .Call(`_arrow_Array__type_id`, x)
+}
+
+Array__Equals <- function(lhs, rhs) {
+    .Call(`_arrow_Array__Equals`, lhs, rhs)
+}
+
+Array__ApproxEquals <- function(lhs, rhs) {
+    .Call(`_arrow_Array__ApproxEquals`, lhs, rhs)
+}
+
+Array__data <- function(array) {
+    .Call(`_arrow_Array__data`, array)
+}
+
+Array__RangeEquals <- function(self, other, start_idx, end_idx, other_start_idx) {
+    .Call(`_arrow_Array__RangeEquals`, self, other, start_idx, end_idx, other_start_idx)
+}
+
+Array__Mask <- function(array) {
+    .Call(`_arrow_Array__Mask`, array)
+}
+
+ArrayData__get_type <- function(x) {
+    .Call(`_arrow_ArrayData__get_type`, x)
+}
+
+ArrayData__get_length <- function(x) {
+    .Call(`_arrow_ArrayData__get_length`, x)
+}
+
+ArrayData__get_null_count <- function(x) {
+    .Call(`_arrow_ArrayData__get_null_count`, x)
+}
+
+ArrayData__get_offset <- function(x) {
+    .Call(`_arrow_ArrayData__get_offset`, x)
+}
+
+ChunkedArray__length <- function(chunked_array) {
+    .Call(`_arrow_ChunkedArray__length`, chunked_array)
+}
+
+ChunkedArray__null_count <- function(chunked_array) {
+    .Call(`_arrow_ChunkedArray__null_count`, chunked_array)
+}
+
+ChunkedArray__num_chunks <- function(chunked_array) {
+    .Call(`_arrow_ChunkedArray__num_chunks`, chunked_array)
+}
+
+ChunkedArray__chunk <- function(chunked_array, i) {
+    .Call(`_arrow_ChunkedArray__chunk`, chunked_array, i)
+}
+
+ChunkedArray__chunks <- function(chunked_array) {
+    .Call(`_arrow_ChunkedArray__chunks`, chunked_array)
+}
+
+ChunkedArray__type <- function(chunked_array) {
+    .Call(`_arrow_ChunkedArray__type`, chunked_array)
+}
+
+ChunkedArray__as_vector <- function(chunked_array) {
+    .Call(`_arrow_ChunkedArray__as_vector`, chunked_array)
+}
+
+ChunkArray__Slice1 <- function(chunked_array, offset) {
+    .Call(`_arrow_ChunkArray__Slice1`, chunked_array, offset)
+}
+
+ChunkArray__Slice2 <- function(chunked_array, offset, length) {
+    .Call(`_arrow_ChunkArray__Slice2`, chunked_array, offset, length)
+}
+
+ChunkedArray__from_list <- function(chunks) {
+    .Call(`_arrow_ChunkedArray__from_list`, chunks)
+}
+
+Column__length <- function(column) {
+    .Call(`_arrow_Column__length`, column)
+}
+
+Column__null_count <- function(column) {
+    .Call(`_arrow_Column__null_count`, column)
+}
+
+Column__type <- function(column) {
+    .Call(`_arrow_Column__type`, column)
+}
+
+Column__data <- function(column) {
+    .Call(`_arrow_Column__data`, column)
+}
+
+Int8__initialize <- function() {
+    .Call(`_arrow_Int8__initialize`)
+}
+
+Int16__initialize <- function() {
+    .Call(`_arrow_Int16__initialize`)
+}
+
+Int32__initialize <- function() {
+    .Call(`_arrow_Int32__initialize`)
+}
+
+Int64__initialize <- function() {
+    .Call(`_arrow_Int64__initialize`)
+}
+
+UInt8__initialize <- function() {
+    .Call(`_arrow_UInt8__initialize`)
+}
+
+UInt16__initialize <- function() {
+    .Call(`_arrow_UInt16__initialize`)
+}
+
+UInt32__initialize <- function() {
+    .Call(`_arrow_UInt32__initialize`)
+}
+
+UInt64__initialize <- function() {
+    .Call(`_arrow_UInt64__initialize`)
+}
+
+Float16__initialize <- function() {
+    .Call(`_arrow_Float16__initialize`)
+}
+
+Float32__initialize <- function() {
+    .Call(`_arrow_Float32__initialize`)
+}
+
+Float64__initialize <- function() {
+    .Call(`_arrow_Float64__initialize`)
+}
+
+Boolean__initialize <- function() {
+    .Call(`_arrow_Boolean__initialize`)
+}
+
+Utf8__initialize <- function() {
+    .Call(`_arrow_Utf8__initialize`)
+}
+
+Date32__initialize <- function() {
+    .Call(`_arrow_Date32__initialize`)
+}
+
+Date64__initialize <- function() {
+    .Call(`_arrow_Date64__initialize`)
+}
+
+Null__initialize <- function() {
+    .Call(`_arrow_Null__initialize`)
+}
+
+Decimal128Type__initialize <- function(precision, scale) {
+    .Call(`_arrow_Decimal128Type__initialize`, precision, scale)
+}
+
+FixedSizeBinary__initialize <- function(byte_width) {
+    .Call(`_arrow_FixedSizeBinary__initialize`, byte_width)
+}
+
+Timestamp__initialize1 <- function(unit) {
+    .Call(`_arrow_Timestamp__initialize1`, unit)
+}
+
+Timestamp__initialize2 <- function(unit, timezone) {
+    .Call(`_arrow_Timestamp__initialize2`, unit, timezone)
+}
+
+Time32__initialize <- function(unit) {
+    .Call(`_arrow_Time32__initialize`, unit)
+}
+
+Time64__initialize <- function(unit) {
+    .Call(`_arrow_Time64__initialize`, unit)
+}
+
+list__ <- function(x) {
+    .Call(`_arrow_list__`, x)
+}
+
+struct_ <- function(fields) {
+    .Call(`_arrow_struct_`, fields)
+}
+
+DataType__ToString <- function(type) {
+    .Call(`_arrow_DataType__ToString`, type)
+}
+
+DataType__name <- function(type) {
+    .Call(`_arrow_DataType__name`, type)
+}
+
+DataType__Equals <- function(lhs, rhs) {
+    .Call(`_arrow_DataType__Equals`, lhs, rhs)
+}
+
+DataType__num_children <- function(type) {
+    .Call(`_arrow_DataType__num_children`, type)
+}
+
+DataType__children_pointer <- function(type) {
+    .Call(`_arrow_DataType__children_pointer`, type)
+}
+
+DataType__id <- function(type) {
+    .Call(`_arrow_DataType__id`, type)
+}
+
+schema_ <- function(fields) {
+    .Call(`_arrow_schema_`, fields)
+}
+
+Schema__ToString <- function(s) {
+    .Call(`_arrow_Schema__ToString`, s)
+}
+
+ListType__ToString <- function(type) {
+    .Call(`_arrow_ListType__ToString`, type)
+}
+
+FixedWidthType__bit_width <- function(type) {
+    .Call(`_arrow_FixedWidthType__bit_width`, type)
+}
+
+DateType__unit <- function(type) {
+    .Call(`_arrow_DateType__unit`, type)
+}
+
+TimeType__unit <- function(type) {
+    .Call(`_arrow_TimeType__unit`, type)
+}
+
+DecimalType__precision <- function(type) {
+    .Call(`_arrow_DecimalType__precision`, type)
+}
+
+DecimalType__scale <- function(type) {
+    .Call(`_arrow_DecimalType__scale`, type)
+}
+
+TimestampType__timezone <- function(type) {
+    .Call(`_arrow_TimestampType__timezone`, type)
+}
+
+TimestampType__unit <- function(type) {
+    .Call(`_arrow_TimestampType__unit`, type)
+}
+
+Object__pointer_address <- function(obj) {
+    .Call(`_arrow_Object__pointer_address`, obj)
+}
+
+Field__initialize <- function(name, type, nullable = TRUE) {
+    .Call(`_arrow_Field__initialize`, name, type, nullable)
+}
+
+Field__ToString <- function(type) {
+    .Call(`_arrow_Field__ToString`, type)
+}
+
+Field__name <- function(type) {
+    .Call(`_arrow_Field__name`, type)
+}
+
+Field__nullable <- function(type) {
+    .Call(`_arrow_Field__nullable`, type)
+}
+
+MemoryPool__default <- function() {
+    .Call(`_arrow_MemoryPool__default`)
+}
+
+MemoryPool__bytes_allocated <- function(pool) {
+    .Call(`_arrow_MemoryPool__bytes_allocated`, pool)
+}
+
+MemoryPool__max_memory <- function(pool) {
+    .Call(`_arrow_MemoryPool__max_memory`, pool)
+}
+
+RecordBatch__num_columns <- function(x) {
+    .Call(`_arrow_RecordBatch__num_columns`, x)
+}
+
+RecordBatch__num_rows <- function(x) {
+    .Call(`_arrow_RecordBatch__num_rows`, x)
+}
+
+RecordBatch__schema <- function(x) {
+    .Call(`_arrow_RecordBatch__schema`, x)
+}
+
+RecordBatch__column <- function(batch, i) {
+    .Call(`_arrow_RecordBatch__column`, batch, i)
+}
+
+RecordBatch__to_dataframe <- function(batch) {
+    .Call(`_arrow_RecordBatch__to_dataframe`, batch)
+}
+
+read_record_batch_ <- function(path) {
+    .Call(`_arrow_read_record_batch_`, path)
+}
+
+RecordBatch__to_file <- function(batch, path) {
+    .Call(`_arrow_RecordBatch__to_file`, batch, path)
+}
+
+RecordBatch__from_dataframe <- function(tbl) {
+    .Call(`_arrow_RecordBatch__from_dataframe`, tbl)
+}
+
+RecordBatch__Equals <- function(self, other) {
+    .Call(`_arrow_RecordBatch__Equals`, self, other)
+}
+
+RecordBatch__RemoveColumn <- function(batch, i) {
+    .Call(`_arrow_RecordBatch__RemoveColumn`, batch, i)
+}
+
+RecordBatch__column_name <- function(batch, i) {
+    .Call(`_arrow_RecordBatch__column_name`, batch, i)
+}
+
+RecordBatch__names <- function(batch) {
+    .Call(`_arrow_RecordBatch__names`, batch)
+}
+
+RecordBatch__Slice1 <- function(self, offset) {
+    .Call(`_arrow_RecordBatch__Slice1`, self, offset)
+}
+
+RecordBatch__Slice2 <- function(self, offset, length) {
+    .Call(`_arrow_RecordBatch__Slice2`, self, offset, length)
+}
+
+Table__from_dataframe <- function(tbl) {
+    .Call(`_arrow_Table__from_dataframe`, tbl)
+}
+
+Table__num_columns <- function(x) {
+    .Call(`_arrow_Table__num_columns`, x)
+}
+
+Table__num_rows <- function(x) {
+    .Call(`_arrow_Table__num_rows`, x)
+}
+
+Table__schema <- function(x) {
+    .Call(`_arrow_Table__schema`, x)
+}
+
+Table__to_file <- function(table, path) {
+    .Call(`_arrow_Table__to_file`, table, path)
+}
+
+read_table_ <- function(path) {
+    .Call(`_arrow_read_table_`, path)
+}
+
+Table__to_dataframe <- function(table) {
+    .Call(`_arrow_Table__to_dataframe`, table)
+}
+
+Table__column <- function(table, i) {
+    .Call(`_arrow_Table__column`, table, i)
 }
 
diff --git a/r/R/RecordBatch.R b/r/R/RecordBatch.R
new file mode 100644
index 0000000..4712aaf
--- /dev/null
+++ b/r/R/RecordBatch.R
@@ -0,0 +1,72 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+#' @include R6.R
+
+`arrow::RecordBatch` <- R6Class("arrow::RecordBatch", inherit = `arrow::Object`,
+  public = list(
+    num_columns = function() RecordBatch__num_columns(self),
+    num_rows = function() RecordBatch__num_rows(self),
+    schema = function() `arrow::Schema`$new(RecordBatch__schema(self)),
+    to_file = function(path) invisible(RecordBatch__to_file(self, fs::path_abs(path))),
+    column = function(i) `arrow::Array`$new(RecordBatch__column(self, i)),
+    column_name = function(i) RecordBatch__column_name(self, i),
+    names = function() RecordBatch__names(self),
+    Equals = function(other) {
+      assert_that(inherits(other, "arrow::RecordBatch"))
+      RecordBatch__Equals(self, other)
+    },
+    RemoveColumn = function(i){
+      `arrow::RecordBatch`$new(RecordBatch__RemoveColumn(self, i))
+    },
+    Slice = function(offset, length = NULL) {
+      if (is.null(length)) {
+        `arrow::RecordBatch`$new(RecordBatch__Slice1(self, offset))
+      } else {
+        `arrow::RecordBatch`$new(RecordBatch__Slice2(self, offset, length))
+      }
+    }
+  )
+)
+
+#' @export
+`names.arrow::RecordBatch` <- function(x) {
+  x$names()
+}
+
+#' @export
+`==.arrow::RecordBatch` <- function(x, y) {
+  x$Equals(y)
+}
+
+#' @export
+`as_tibble.arrow::RecordBatch` <- function(x, ...){
+  RecordBatch__to_dataframe(x)
+}
+
+#' Create an arrow::RecordBatch from a data frame
+#'
+#' @param .data a data frame
+#'
+#' @export
+record_batch <- function(.data){
+  `arrow::RecordBatch`$new(RecordBatch__from_dataframe(.data))
+}
+
+read_record_batch <- function(path){
+  `arrow::RecordBatch`$new(read_record_batch_(fs::path_abs(path)))
+}
diff --git a/.gitignore b/r/R/Schema.R
similarity index 74%
copy from .gitignore
copy to r/R/Schema.R
index 2a19b34..7f1635d 100644
--- a/.gitignore
+++ b/r/R/Schema.R
@@ -15,27 +15,17 @@
 # specific language governing permissions and limitations
 # under the License.
 
-# Compiled source
-*.a
-*.dll
-*.o
-*.py[ocd]
-*.so
-*.so.*
-*.dylib
-.build_cache_dir
-MANIFEST
+#' @include R6.R
 
-# Generated Visual Studio files
-*.vcxproj
-*.vcxproj.*
-*.sln
-*.iml
+`arrow::Schema` <- R6Class("arrow::Schema",
+  inherit = `arrow::Object`,
+  public = list(
+    ToString = function() Schema__ToString(self)
+  )
+)
 
-cpp/.idea/
-python/.eggs/
-.vscode
-.idea/
-.pytest_cache/
-pkgs
-.Rproj.user
+#' @rdname DataType
+#' @export
+schema <- function(...){
+  `arrow::Schema`$new(schema_(.fields(list(...))))
+}
diff --git a/r/tests/testthat.R b/r/R/Struct.R
similarity index 78%
copy from r/tests/testthat.R
copy to r/R/Struct.R
index cda8cf9..52e7d6f 100644
--- a/r/tests/testthat.R
+++ b/r/R/Struct.R
@@ -15,7 +15,14 @@
 # specific language governing permissions and limitations
 # under the License.
 
-library(testthat)
-library(arrow)
+#' @include R6.R
 
-test_check("arrow")
+`arrow::StructType` <- R6Class("arrow::StructType",
+  inherit = `arrow::NestedType`
+)
+
+#' @rdname DataType
+#' @export
+struct <- function(...){
+  `arrow::StructType`$new(struct_(.fields(list(...))))
+}
diff --git a/r/R/Table.R b/r/R/Table.R
new file mode 100644
index 0000000..a725c6e
--- /dev/null
+++ b/r/R/Table.R
@@ -0,0 +1,67 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+#' @include R6.R
+
+`arrow::Table` <- R6Class("arrow::Table", inherit = `arrow::Object`,
+  public = list(
+    num_columns = function() Table__num_columns(self),
+    num_rows = function() Table__num_rows(self),
+    schema = function() `arrow::Schema`$new(Table__schema(self)),
+    to_file = function(path) invisible(Table__to_file(self, fs::path_abs(path))),
+    column = function(i) `arrow::Column`$new(Table__column(self, i))
+  )
+)
+
+#' Create an arrow::Table from a data frame
+#'
+#' @param .data a data frame
+#'
+#' @export
+table <- function(.data){
+  `arrow::Table`$new(Table__from_dataframe(.data))
+}
+
+#' Write a tibble in a binary arrow file
+#'
+#' @param data a [tibble::tibble]
+#' @param path file path
+#'
+#' @export
+write_arrow <- function(data, path){
+  table(data)$to_file(path)
+}
+
+read_table <- function(path){
+  `arrow::Table`$new(read_table_(fs::path_abs(path)))
+}
+
+#' @export
+`as_tibble.arrow::Table` <- function(x, ...){
+  Table__to_dataframe(x)
+}
+
+#' Read an tibble from an arrow::Table on disk
+#'
+#' @param path binary arrow file
+#'
+#' @return a [tibble::tibble]
+#'
+#' @export
+read_arrow <- function(path){
+  as_tibble(read_table(path))
+}
diff --git a/r/R/array.R b/r/R/array.R
new file mode 100644
index 0000000..6e90c7d
--- /dev/null
+++ b/r/R/array.R
@@ -0,0 +1,62 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+#' @include R6.R
+
+`arrow::Array` <- R6Class("arrow::Array",
+  inherit = `arrow::Object`,
+  public = list(
+    IsNull = function(i) Array__IsNull(self, i),
+    IsValid = function(i) Array__IsValid(self, i),
+    length = function() Array__length(self),
+    offset = function() Array__offset(self),
+    null_count = function() Array__null_count(self),
+    type = function() `arrow::DataType`$dispatch(Array__type(self)),
+    type_id = function() Array__type_id(self),
+    Equals = function(other) Array__Equals(self, other),
+    ApproxEquals = function(othet) Array__ApproxEquals(self, other),
+    data = function() `arrow::ArrayData`$new(Array__data(self)),
+    as_vector = function() Array__as_vector(self),
+    ToString = function() Array__ToString(self),
+    Slice = function(offset, length = NULL){
+      if (is.null(length)) {
+        `arrow::Array`$new(Array__Slice1(self, offset))
+      } else {
+        `arrow::Array`$new(Array__Slice2(self, offset, length))
+      }
+    },
+    RangeEquals = function(other, start_idx, end_idx, other_start_idx) {
+      assert_that(inherits(other, "arrow::Array"))
+      Array__RangeEquals(self, other, start_idx, end_idx, other_start_idx)
+    }
+  )
+)
+
+#' @export
+`length.arrow::Array` <- function(x) x$length()
+
+#' @export
+`==.arrow::Array` <- function(x, y) x$Equals(y)
+
+#' create an arrow::Array from an R vector
+#'
+#' @param \dots Vectors to coerce
+#'
+#' @export
+array <- function(...){
+  `arrow::Array`$new(Array__from_vector(vctrs::vec_c(...)))
+}
diff --git a/r/R/enums.R b/r/R/enums.R
new file mode 100644
index 0000000..3649d4e
--- /dev/null
+++ b/r/R/enums.R
@@ -0,0 +1,63 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+#' @export
+`$.arrow-enum` <- function(x, y){
+  structure(unclass(x)[[y]], class = class(x))
+}
+
+#' @export
+`print.arrow-enum` <- function(x, ...){
+  NextMethod()
+}
+
+#' @importFrom rlang seq2 quo_name set_names
+#' @importFrom purrr map_chr
+enum <- function(class, ...){
+  names <- purrr::map_chr(rlang::quos(...), rlang::quo_name)
+  names[is.na(names)] <- "NA"
+
+  structure(
+    rlang::set_names(rlang::seq2(0L, length(names)-1), names),
+    class = c(class, "arrow-enum")
+  )
+}
+
+#' @rdname DataType
+#' @export
+TimeUnit <- enum("arrow::TimeUnit::type", SECOND, MILLI, MICRO, NANO)
+
+#' @rdname DataType
+#' @export
+DateUnit <- enum("arrow::DateUnit", DAY, MILLI)
+
+#' @rdname DataType
+#' @export
+Type <- enum("arrow::Type::type",
+  NA, BOOL, UINT8, INT8, UINT16, INT16, UINT32, INT32, UINT64, INT64,
+  HALF_FLOAT, FLOAT, DOUBLE, STRING, BINARY, DATE32, DATE64, TIMESTAMP,
+  INTERVAL, DECIMAL, LIST, STRUCT, UNION, DICTIONARY, MAP
+)
+
+#' @rdname DataType
+#' @export
+StatusCode <- enum("arrow::StatusCode",
+  OK, OutOfMemory, KeyError, TypeError, Invalid, IOError,
+  CapacityError, UnknownError, NotImplemented, SerializationError,
+  PythonError, PlasmaObjectExists, PlasmaObjectNonexistent, PlasmaStoreFull,
+  PlasmaObjectAlreadySealed
+)
diff --git a/.gitignore b/r/R/memory_pool.R
similarity index 66%
copy from .gitignore
copy to r/R/memory_pool.R
index 2a19b34..c738c00 100644
--- a/.gitignore
+++ b/r/R/memory_pool.R
@@ -15,27 +15,19 @@
 # specific language governing permissions and limitations
 # under the License.
 
-# Compiled source
-*.a
-*.dll
-*.o
-*.py[ocd]
-*.so
-*.so.*
-*.dylib
-.build_cache_dir
-MANIFEST
+#' @include R6.R
 
-# Generated Visual Studio files
-*.vcxproj
-*.vcxproj.*
-*.sln
-*.iml
+`arrow::MemoryPool` <- R6Class("arrow::MemoryPool",
+  inherit = `arrow::Object`,
+  public = list(
+    # TODO: Allocate
+    # TODO: Reallocate
+    # TODO: Free
+    bytes_allocated = function() MemoryPool__bytes_allocated(self),
+    max_memory = function() MemoryPool__max_memory(self)
+  )
+)
 
-cpp/.idea/
-python/.eggs/
-.vscode
-.idea/
-.pytest_cache/
-pkgs
-.Rproj.user
+default_memory_pool <- function() {
+  `arrow::MemoryPool`$new(MemoryPool__default())
+}
diff --git a/r/tests/testthat/test-arrow.R b/r/R/reexports-tibble.R
similarity index 87%
rename from r/tests/testthat/test-arrow.R
rename to r/R/reexports-tibble.R
index f76d7ee..de445c2 100644
--- a/r/tests/testthat/test-arrow.R
+++ b/r/R/reexports-tibble.R
@@ -15,8 +15,6 @@
 # specific language governing permissions and limitations
 # under the License.
 
-context("test-arrow.R")
-
-test_that("can use arrow C++ library", {
-  expect_equal(arrow:::ping_arrow(), "int32")
-})
+#' @importFrom tibble as_tibble
+#' @export
+tibble::as_tibble
diff --git a/r/README.Rmd b/r/README.Rmd
index db482da..204a9f9 100644
--- a/r/README.Rmd
+++ b/r/README.Rmd
@@ -29,7 +29,7 @@ cmake .. -DCMAKE_BUILD_TYPE=Release -DARROW_BOOST_USE_SHARED:BOOL=Off
 make install
 ```
 
-Then the R package: 
+Then the R package:
 
 ```r
 devtools::install_github("apache/arrow/r")
@@ -37,4 +37,18 @@ devtools::install_github("apache/arrow/r")
 
 ## Example
 
-(not yet)
+```{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())
+```
diff --git a/r/README.md b/r/README.md
index 0597006..0ac7815 100644
--- a/r/README.md
+++ b/r/README.md
@@ -26,4 +26,44 @@ devtools::install_github("apache/arrow/r")
 
 ## Example
 
-(not yet)
+``` 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)))
+#> # A tibble: 10 x 2
+#>        x       y
+#>    <int>   <dbl>
+#>  1     1 -0.255 
+#>  2     2 -0.162 
+#>  3     3 -0.614 
+#>  4     4 -0.322 
+#>  5     5  0.0693
+#>  6     6 -0.920 
+#>  7     7 -1.08  
+#>  8     8  0.658 
+#>  9     9  0.821 
+#> 10    10  0.539
+arrow::write_arrow(tib, tf)
+
+# read it back with pyarrow
+pa <- import("pyarrow")
+as_tibble(pa$open_file(tf)$read_pandas())
+#> # A tibble: 10 x 2
+#>        x       y
+#>    <int>   <dbl>
+#>  1     1 -0.255 
+#>  2     2 -0.162 
+#>  3     3 -0.614 
+#>  4     4 -0.322 
+#>  5     5  0.0693
+#>  6     6 -0.920 
+#>  7     7 -1.08  
+#>  8     8  0.658 
+#>  9     9  0.821 
+#> 10    10  0.539
+```
diff --git a/r/data-raw/test.R b/r/data-raw/test.R
new file mode 100644
index 0000000..60f2607
--- /dev/null
+++ b/r/data-raw/test.R
@@ -0,0 +1,85 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+library(tidyverse)
+library(arrow)
+
+# meta data
+(t1 <- int32())
+(t2 <- utf8())
+(t5 <- timestamp(unit = TimeUnit$MILLI))
+
+# lists
+list_of(t1)
+
+# shema
+schema(x = int32(), y = float64())
+
+# :scream_cat:
+#
+# pa.schema(
+#   [
+#      pa.field('x', pa.int32()),
+#      pa.field('y', pa.float64())
+#   ]
+# )
+#
+
+schema(x = int32(), y = list_of(float64()))
+
+#------- arrays
+
+# arr = pa.array([1, 2, 3])
+arr <- array(1:3, 5:80)
+arr
+arr$as_vector()
+
+#------- read_arrow / write_arrow
+tbl <- tibble(x=1:10, y=rnorm(10))
+write_arrow(tbl, "/tmp/test.arrow")
+readr::write_rds(tbl, "/tmp/test.rds")
+fs::file_info(c("/tmp/test.arrow", "/tmp/test.rds"))
+
+(data <- read_arrow("/tmp/test.arrow"))
+
+# tibble <-> arrow::RecordBatch
+(batch <- record_batch(tbl))
+batch$num_columns()
+batch$num_rows()
+batch$to_file("/tmp/test")
+readBin("/tmp/test", what = raw(), n = 1000)
+batch$schema()
+all.equal(tbl, data)
+
+batch <- read_record_batch("/tmp/test")
+batch$schema()
+batch$column(0)
+batch$column(0)$as_vector()
+
+as_tibble(batch)
+
+# tibble <-> arrow::Table
+tab <- arrow::table(tbl)
+tab
+tab$schema()
+tab$num_columns()
+tab$num_rows()
+
+# read_arrow, write_arrow
+tbl <- tibble(x = rnorm(20), y = seq_len(20))
+write_arrow(tbl, tf)
+
diff --git a/r/man/DataType.Rd b/r/man/DataType.Rd
new file mode 100644
index 0000000..92d959c
--- /dev/null
+++ b/r/man/DataType.Rd
@@ -0,0 +1,106 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/enums.R, R/R6.R, R/List.R, R/Schema.R,
+%   R/Struct.R
+\docType{data}
+\name{TimeUnit}
+\alias{TimeUnit}
+\alias{DateUnit}
+\alias{Type}
+\alias{StatusCode}
+\alias{int8}
+\alias{int16}
+\alias{int32}
+\alias{int64}
+\alias{uint8}
+\alias{uint16}
+\alias{uint32}
+\alias{uint64}
+\alias{float16}
+\alias{float32}
+\alias{float64}
+\alias{boolean}
+\alias{utf8}
+\alias{date32}
+\alias{date64}
+\alias{time32}
+\alias{time64}
+\alias{null}
+\alias{timestamp}
+\alias{decimal}
+\alias{list_of}
+\alias{schema}
+\alias{struct}
+\title{Apache Arrow data types}
+\format{An object of class \code{arrow::TimeUnit::type} (inherits from \code{arrow-enum}) of length 4.}
+\usage{
+TimeUnit
+
+DateUnit
+
+Type
+
+StatusCode
+
+int8()
+
+int16()
+
+int32()
+
+int64()
+
+uint8()
+
+uint16()
+
+uint32()
+
+uint64()
+
+float16()
+
+float32()
+
+float64()
+
+boolean()
+
+utf8()
+
+date32()
+
+date64()
+
+time32(unit)
+
+time64(unit)
+
+null()
+
+timestamp(unit, timezone)
+
+decimal(precision, scale)
+
+list_of(type)
+
+schema(...)
+
+struct(...)
+}
+\arguments{
+\item{unit}{time unit}
+
+\item{timezone}{time zone}
+
+\item{precision}{precision}
+
+\item{scale}{scale}
+
+\item{type}{type}
+
+\item{...}{...}
+}
+\description{
+Apache Arrow data types
+}
+\keyword{datasets}
diff --git a/r/man/array.Rd b/r/man/array.Rd
new file mode 100644
index 0000000..ed81d0c
--- /dev/null
+++ b/r/man/array.Rd
@@ -0,0 +1,14 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/array.R
+\name{array}
+\alias{array}
+\title{create an arrow::Array from an R vector}
+\usage{
+array(...)
+}
+\arguments{
+\item{\dots}{Vectors to coerce}
+}
+\description{
+create an arrow::Array from an R vector
+}
diff --git a/r/man/chunked_array.Rd b/r/man/chunked_array.Rd
new file mode 100644
index 0000000..27b91cf
--- /dev/null
+++ b/r/man/chunked_array.Rd
@@ -0,0 +1,14 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/ChunkedArray.R
+\name{chunked_array}
+\alias{chunked_array}
+\title{create an arrow::Array from an R vector}
+\usage{
+chunked_array(...)
+}
+\arguments{
+\item{\dots}{Vectors to coerce}
+}
+\description{
+create an arrow::Array from an R vector
+}
diff --git a/r/man/read_arrow.Rd b/r/man/read_arrow.Rd
new file mode 100644
index 0000000..8fe7875
--- /dev/null
+++ b/r/man/read_arrow.Rd
@@ -0,0 +1,17 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/Table.R
+\name{read_arrow}
+\alias{read_arrow}
+\title{Read an tibble from an arrow::Table on disk}
+\usage{
+read_arrow(path)
+}
+\arguments{
+\item{path}{binary arrow file}
+}
+\value{
+a \link[tibble:tibble]{tibble::tibble}
+}
+\description{
+Read an tibble from an arrow::Table on disk
+}
diff --git a/r/man/record_batch.Rd b/r/man/record_batch.Rd
new file mode 100644
index 0000000..e108d64
--- /dev/null
+++ b/r/man/record_batch.Rd
@@ -0,0 +1,14 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/RecordBatch.R
+\name{record_batch}
+\alias{record_batch}
+\title{Create an arrow::RecordBatch from a data frame}
+\usage{
+record_batch(.data)
+}
+\arguments{
+\item{.data}{a data frame}
+}
+\description{
+Create an arrow::RecordBatch from a data frame
+}
diff --git a/r/man/reexports.Rd b/r/man/reexports.Rd
new file mode 100644
index 0000000..5171b3e
--- /dev/null
+++ b/r/man/reexports.Rd
@@ -0,0 +1,16 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/reexports-tibble.R
+\docType{import}
+\name{reexports}
+\alias{reexports}
+\alias{as_tibble}
+\title{Objects exported from other packages}
+\keyword{internal}
+\description{
+These objects are imported from other packages. Follow the links
+below to see their documentation.
+
+\describe{
+  \item{tibble}{\code{\link[tibble]{as_tibble}}}
+}}
+
diff --git a/r/man/table.Rd b/r/man/table.Rd
new file mode 100644
index 0000000..743ee06
--- /dev/null
+++ b/r/man/table.Rd
@@ -0,0 +1,14 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/Table.R
+\name{table}
+\alias{table}
+\title{Create an arrow::Table from a data frame}
+\usage{
+table(.data)
+}
+\arguments{
+\item{.data}{a data frame}
+}
+\description{
+Create an arrow::Table from a data frame
+}
diff --git a/r/man/write_arrow.Rd b/r/man/write_arrow.Rd
new file mode 100644
index 0000000..ff48d1e
--- /dev/null
+++ b/r/man/write_arrow.Rd
@@ -0,0 +1,16 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/Table.R
+\name{write_arrow}
+\alias{write_arrow}
+\title{Write a tibble in a binary arrow file}
+\usage{
+write_arrow(data, path)
+}
+\arguments{
+\item{data}{a \link[tibble:tibble]{tibble::tibble}}
+
+\item{path}{file path}
+}
+\description{
+Write a tibble in a binary arrow file
+}
diff --git a/r/tests/testthat.R b/r/src/.clang-format
similarity index 91%
copy from r/tests/testthat.R
copy to r/src/.clang-format
index cda8cf9..06453df 100644
--- a/r/tests/testthat.R
+++ b/r/src/.clang-format
@@ -14,8 +14,7 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-
-library(testthat)
-library(arrow)
-
-test_check("arrow")
+---
+BasedOnStyle:  Google
+DerivePointerAlignment: false
+ColumnLimit: 90
diff --git a/r/src/r_arrow_types.h b/r/src/ArrayData.cpp
similarity index 59%
rename from r/src/r_arrow_types.h
rename to r/src/ArrayData.cpp
index 6fa6e23..fc6fba1 100644
--- a/r/src/r_arrow_types.h
+++ b/r/src/ArrayData.cpp
@@ -15,8 +15,26 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#pragma once
+#include "arrow_types.h"
 
-#define STRICT_R_HEADERS
-#include <Rcpp.h>
-#include <arrow/api.h>
+using namespace Rcpp;
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::DataType> ArrayData__get_type(const std::shared_ptr<arrow::ArrayData>& x){
+  return x->type;
+}
+
+// [[Rcpp::export]]
+int ArrayData__get_length(const std::shared_ptr<arrow::ArrayData>& x){
+  return x->length;
+}
+
+// [[Rcpp::export]]
+int ArrayData__get_null_count(const std::shared_ptr<arrow::ArrayData>& x){
+  return x->null_count;
+}
+
+// [[Rcpp::export]]
+int ArrayData__get_offset(const std::shared_ptr<arrow::ArrayData>& x){
+  return x->offset;
+}
diff --git a/r/src/ChunkedArray.cpp b/r/src/ChunkedArray.cpp
new file mode 100644
index 0000000..66b83cb
--- /dev/null
+++ b/r/src/ChunkedArray.cpp
@@ -0,0 +1,123 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "arrow_types.h"
+
+using namespace Rcpp;
+using namespace arrow;
+
+template <int RTYPE>
+inline SEXP simple_ChunkedArray_to_Vector(const std::shared_ptr<arrow::ChunkedArray>& chunked_array){
+  using stored_type = typename Rcpp::Vector<RTYPE>::stored_type;
+  Rcpp::Vector<RTYPE> out = no_init(chunked_array->length());
+  auto p = out.begin();
+
+  int k = 0;
+  for (int i=0; i<chunked_array->num_chunks(); i++) {
+    auto chunk = chunked_array->chunk(i);
+    auto n = chunk->length();
+
+    // copy the data
+    auto q = p;
+    p = std::copy_n(
+      reinterpret_cast<const stored_type*>(
+        chunk->data()->buffers[1]->data() + chunk->offset() * sizeof(stored_type)
+      ),
+      n, p);
+
+    // set NA using the bitmap
+    auto bitmap_data = chunk->null_bitmap();
+    if (bitmap_data && RTYPE != RAWSXP) {
+      arrow::internal::BitmapReader bitmap_reader(
+          bitmap_data->data(), chunk->offset(), n
+      );
+
+      for (int j=0; j<n; j++, bitmap_reader.Next()){
+        if (bitmap_reader.IsNotSet()) {
+          q[k+j] = Rcpp::Vector<RTYPE>::get_na();
+        }
+      }
+    }
+
+    k += chunk->length();
+  }
+  return out;
+}
+
+
+// [[Rcpp::export]]
+int ChunkedArray__length(const std::shared_ptr<arrow::ChunkedArray>& chunked_array){
+  return chunked_array->length();
+}
+
+// [[Rcpp::export]]
+int ChunkedArray__null_count(const std::shared_ptr<arrow::ChunkedArray>& chunked_array){
+  return chunked_array->null_count();
+}
+
+// [[Rcpp::export]]
+int ChunkedArray__num_chunks(const std::shared_ptr<arrow::ChunkedArray>& chunked_array){
+  return chunked_array->num_chunks();
+}
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::Array> ChunkedArray__chunk(const std::shared_ptr<arrow::ChunkedArray>& chunked_array, int i){
+  return chunked_array->chunk(i);
+}
+
+// [[Rcpp::export]]
+List ChunkedArray__chunks(const std::shared_ptr<arrow::ChunkedArray>& chunked_array){
+  return wrap(chunked_array->chunks());
+}
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::DataType> ChunkedArray__type(const std::shared_ptr<arrow::ChunkedArray>& chunked_array){
+  return chunked_array->type();
+}
+
+// [[Rcpp::export]]
+SEXP ChunkedArray__as_vector(const std::shared_ptr<arrow::ChunkedArray>& chunked_array){
+  switch(chunked_array->type()->id()){
+    case Type::INT8: return simple_ChunkedArray_to_Vector<RAWSXP>(chunked_array);
+    case Type::INT32: return simple_ChunkedArray_to_Vector<INTSXP>(chunked_array);
+    case Type::DOUBLE: return simple_ChunkedArray_to_Vector<REALSXP>(chunked_array);
+    default:
+      break;
+  }
+
+  stop(tfm::format("cannot handle Array of type %d", chunked_array->type()->id()));
+  return R_NilValue;
+}
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::ChunkedArray> ChunkArray__Slice1( const std::shared_ptr<arrow::ChunkedArray>& chunked_array, int offset) {
+  return chunked_array->Slice(offset);
+}
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::ChunkedArray> ChunkArray__Slice2( const std::shared_ptr<arrow::ChunkedArray>& chunked_array, int offset, int length) {
+  return chunked_array->Slice(offset, length);
+}
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::ChunkedArray> ChunkedArray__from_list(List chunks){
+  std::vector<std::shared_ptr<arrow::Array>> vec;
+  for ( SEXP chunk: chunks) {
+    vec.push_back(Array__from_vector(chunk));
+  }
+  return std::make_shared<arrow::ChunkedArray>(std::move(vec));
+}
diff --git a/r/src/hello.cpp b/r/src/Column.cpp
similarity index 60%
copy from r/src/hello.cpp
copy to r/src/Column.cpp
index ddb512e..4b0c597 100644
--- a/r/src/hello.cpp
+++ b/r/src/Column.cpp
@@ -15,12 +15,24 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include "r_arrow_types.h"
+#include "arrow_types.h"
 
-using namespace Rcpp ;
-using namespace arrow ;
+// [[Rcpp::export]]
+int Column__length(const std::shared_ptr<arrow::Column>& column) {
+  return column->length();
+}
+
+// [[Rcpp::export]]
+int Column__null_count(const std::shared_ptr<arrow::Column>& column) {
+  return column->null_count();
+}
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::DataType> Column__type(const std::shared_ptr<arrow::Column>& column) {
+  return column->type();
+}
 
 // [[Rcpp::export]]
-std::string ping_arrow(){
-  return arrow::int32()->name();
+std::shared_ptr<arrow::ChunkedArray> Column__data(const std::shared_ptr<arrow::Column>& column) {
+  return column->data();
 }
diff --git a/r/src/DataType.cpp b/r/src/DataType.cpp
new file mode 100644
index 0000000..b038a49
--- /dev/null
+++ b/r/src/DataType.cpp
@@ -0,0 +1,212 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "arrow_types.h"
+
+using namespace Rcpp;
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::DataType> Int8__initialize() { return arrow::int8(); }
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::DataType> Int16__initialize() { return arrow::int16(); }
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::DataType> Int32__initialize() { return arrow::int32(); }
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::DataType> Int64__initialize() { return arrow::int64(); }
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::DataType> UInt8__initialize() { return arrow::uint8(); }
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::DataType> UInt16__initialize() { return arrow::uint16(); }
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::DataType> UInt32__initialize() { return arrow::uint32(); }
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::DataType> UInt64__initialize() { return arrow::uint64(); }
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::DataType> Float16__initialize() { return arrow::float16(); }
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::DataType> Float32__initialize() { return arrow::float32(); }
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::DataType> Float64__initialize() { return arrow::float64(); }
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::DataType> Boolean__initialize() { return arrow::boolean(); }
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::DataType> Utf8__initialize() { return arrow::utf8(); }
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::DataType> Date32__initialize() { return arrow::date32(); }
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::DataType> Date64__initialize() { return arrow::date64(); }
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::DataType> Null__initialize() { return arrow::null(); }
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::DataType> Decimal128Type__initialize(int32_t precision, int32_t scale) {
+  return arrow::decimal(precision, scale);
+}
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::DataType> FixedSizeBinary__initialize(int32_t byte_width) {
+  return arrow::fixed_size_binary(byte_width);
+}
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::DataType> Timestamp__initialize1(arrow::TimeUnit::type unit) {
+  return arrow::timestamp(unit);
+}
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::DataType> Timestamp__initialize2(arrow::TimeUnit::type unit, const std::string& timezone) {
+  return arrow::timestamp(unit, timezone);
+}
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::DataType> Time32__initialize(arrow::TimeUnit::type unit) {
+  return arrow::time32(unit);
+}
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::DataType> Time64__initialize(arrow::TimeUnit::type unit) {
+  return arrow::time64(unit);
+}
+
+// [[Rcpp::export]]
+SEXP list__(SEXP x) {
+  if (Rf_inherits(x, "arrow::Field")) {
+    return wrap(arrow::list(Rcpp::as<std::shared_ptr<arrow::Field>>(x)));
+  }
+
+  if (Rf_inherits(x, "arrow::DataType")) {
+    return wrap(arrow::list(Rcpp::as<std::shared_ptr<arrow::DataType>>(x)));
+  }
+
+  stop("incompatible");
+  return R_NilValue;
+}
+
+template <typename T>
+std::vector<std::shared_ptr<T>> List_to_shared_ptr_vector(List x){
+  int n = x.size();
+  std::vector<std::shared_ptr<T>> vec;
+  for( SEXP element: x){
+    vec.push_back(as<std::shared_ptr<T>>(element));
+  }
+  return vec;
+}
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::DataType> struct_(List fields) {
+  return arrow::struct_(List_to_shared_ptr_vector<arrow::Field>(fields));
+}
+
+// [[Rcpp::export]]
+std::string DataType__ToString(const std::shared_ptr<arrow::DataType>& type) {
+  return type->ToString();
+}
+
+// [[Rcpp::export]]
+std::string DataType__name(const std::shared_ptr<arrow::DataType>& type) {
+  return type->name();
+}
+
+// [[Rcpp::export]]
+bool DataType__Equals(const std::shared_ptr<arrow::DataType>& lhs, const std::shared_ptr<arrow::DataType>& rhs) {
+  return lhs->Equals(*rhs);
+}
+
+// [[Rcpp::export]]
+int DataType__num_children(const std::shared_ptr<arrow::DataType>& type) {
+  return type->num_children();
+}
+
+// [[Rcpp::export]]
+List DataType__children_pointer(const std::shared_ptr<arrow::DataType>& type) {
+  return List(type->children().begin(), type->children().end());
+}
+
+// [[Rcpp::export]]
+arrow::Type::type DataType__id(const std::shared_ptr<arrow::DataType>& type) {
+  return type->id();
+}
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::Schema> schema_(List fields) {
+  return arrow::schema(List_to_shared_ptr_vector<arrow::Field>(fields));
+}
+
+// [[Rcpp::export]]
+std::string Schema__ToString(const std::shared_ptr<arrow::Schema>& s) {
+  return s->ToString();
+}
+
+// [[Rcpp::export]]
+std::string ListType__ToString(const std::shared_ptr<arrow::ListType>& type) {
+  return type->ToString();
+}
+
+// [[Rcpp::export]]
+int FixedWidthType__bit_width(const std::shared_ptr<arrow::FixedWidthType>& type){
+  return type->bit_width();
+}
+
+// [[Rcpp::export]]
+arrow::DateUnit DateType__unit(const std::shared_ptr<arrow::DateType>& type){
+  return type->unit();
+}
+
+// [[Rcpp::export]]
+arrow::TimeUnit::type TimeType__unit(const std::shared_ptr<arrow::TimeType>& type){
+  return type->unit();
+}
+
+// [[Rcpp::export]]
+int32_t DecimalType__precision(const std::shared_ptr<arrow::DecimalType>& type) {
+  return type->precision();
+}
+
+// [[Rcpp::export]]
+int32_t DecimalType__scale(const std::shared_ptr<arrow::DecimalType>& type) {
+  return type->scale();
+}
+
+// [[Rcpp::export]]
+std::string TimestampType__timezone(const std::shared_ptr<arrow::TimestampType>& type) {
+  return type->timezone();
+}
+
+// [[Rcpp::export]]
+arrow::TimeUnit::type TimestampType__unit(const std::shared_ptr<arrow::TimestampType>& type) {
+  return type->unit();
+}
+
+// [[Rcpp::export]]
+std::string Object__pointer_address(SEXP obj){
+  return tfm::format("%p", EXTPTR_PTR(obj));
+}
diff --git a/r/src/Makevars.in b/r/src/Makevars.in
index 7a6b1fd..8277c6c 100644
--- a/r/src/Makevars.in
+++ b/r/src/Makevars.in
@@ -18,4 +18,4 @@
 PKG_CPPFLAGS=@cflags@
 PKG_CXXFLAGS=$(C_VISIBILITY)
 CXX_STD=CXX11
-PKG_LIBS=@libs@
+PKG_LIBS=@libs@  -Wl,-rpath,/usr/local/lib
diff --git a/r/src/hello.cpp b/r/src/MemoryPool.cpp
similarity index 64%
copy from r/src/hello.cpp
copy to r/src/MemoryPool.cpp
index ddb512e..ddc1e05 100644
--- a/r/src/hello.cpp
+++ b/r/src/MemoryPool.cpp
@@ -15,12 +15,21 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include "r_arrow_types.h"
+#include "arrow_types.h"
 
-using namespace Rcpp ;
-using namespace arrow ;
+using namespace Rcpp;
 
 // [[Rcpp::export]]
-std::string ping_arrow(){
-  return arrow::int32()->name();
+std::shared_ptr<arrow::MemoryPool> MemoryPool__default(){
+  return std::shared_ptr<arrow::MemoryPool>(arrow::default_memory_pool(), NoDelete<arrow::MemoryPool>());
+}
+
+// [[Rcpp::export]]
+int MemoryPool__bytes_allocated(std::shared_ptr<arrow::MemoryPool> pool){
+  return pool->bytes_allocated();
+}
+
+// [[Rcpp::export]]
+int MemoryPool__max_memory(std::shared_ptr<arrow::MemoryPool> pool){
+  return pool->max_memory();
 }
diff --git a/r/src/RcppExports.cpp b/r/src/RcppExports.cpp
index d819d65..200071b 100644
--- a/r/src/RcppExports.cpp
+++ b/r/src/RcppExports.cpp
@@ -1,23 +1,1286 @@
 // Generated by using Rcpp::compileAttributes() -> do not edit by hand
 // Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
 
+#include "arrow_types.h"
 #include <Rcpp.h>
 
 using namespace Rcpp;
 
-// ping_arrow
-std::string ping_arrow();
-RcppExport SEXP _arrow_ping_arrow() {
+// Array__from_vector
+std::shared_ptr<arrow::Array> Array__from_vector(SEXP x);
+RcppExport SEXP _arrow_Array__from_vector(SEXP xSEXP) {
 BEGIN_RCPP
     Rcpp::RObject rcpp_result_gen;
     Rcpp::RNGScope rcpp_rngScope_gen;
-    rcpp_result_gen = Rcpp::wrap(ping_arrow());
+    Rcpp::traits::input_parameter< SEXP >::type x(xSEXP);
+    rcpp_result_gen = Rcpp::wrap(Array__from_vector(x));
+    return rcpp_result_gen;
+END_RCPP
+}
+// Array__as_vector
+SEXP Array__as_vector(const std::shared_ptr<arrow::Array>& array);
+RcppExport SEXP _arrow_Array__as_vector(SEXP arraySEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::Array>& >::type array(arraySEXP);
+    rcpp_result_gen = Rcpp::wrap(Array__as_vector(array));
+    return rcpp_result_gen;
+END_RCPP
+}
+// Array__Slice1
+std::shared_ptr<arrow::Array> Array__Slice1(const std::shared_ptr<arrow::Array>& array, int offset);
+RcppExport SEXP _arrow_Array__Slice1(SEXP arraySEXP, SEXP offsetSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::Array>& >::type array(arraySEXP);
+    Rcpp::traits::input_parameter< int >::type offset(offsetSEXP);
+    rcpp_result_gen = Rcpp::wrap(Array__Slice1(array, offset));
+    return rcpp_result_gen;
+END_RCPP
+}
+// Array__Slice2
+std::shared_ptr<arrow::Array> Array__Slice2(const std::shared_ptr<arrow::Array>& array, int offset, int length);
+RcppExport SEXP _arrow_Array__Slice2(SEXP arraySEXP, SEXP offsetSEXP, SEXP lengthSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::Array>& >::type array(arraySEXP);
+    Rcpp::traits::input_parameter< int >::type offset(offsetSEXP);
+    Rcpp::traits::input_parameter< int >::type length(lengthSEXP);
+    rcpp_result_gen = Rcpp::wrap(Array__Slice2(array, offset, length));
+    return rcpp_result_gen;
+END_RCPP
+}
+// Array__IsNull
+bool Array__IsNull(const std::shared_ptr<arrow::Array>& x, int i);
+RcppExport SEXP _arrow_Array__IsNull(SEXP xSEXP, SEXP iSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::Array>& >::type x(xSEXP);
+    Rcpp::traits::input_parameter< int >::type i(iSEXP);
+    rcpp_result_gen = Rcpp::wrap(Array__IsNull(x, i));
+    return rcpp_result_gen;
+END_RCPP
+}
+// Array__IsValid
+bool Array__IsValid(const std::shared_ptr<arrow::Array>& x, int i);
+RcppExport SEXP _arrow_Array__IsValid(SEXP xSEXP, SEXP iSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::Array>& >::type x(xSEXP);
+    Rcpp::traits::input_parameter< int >::type i(iSEXP);
+    rcpp_result_gen = Rcpp::wrap(Array__IsValid(x, i));
+    return rcpp_result_gen;
+END_RCPP
+}
+// Array__length
+int Array__length(const std::shared_ptr<arrow::Array>& x);
+RcppExport SEXP _arrow_Array__length(SEXP xSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::Array>& >::type x(xSEXP);
+    rcpp_result_gen = Rcpp::wrap(Array__length(x));
+    return rcpp_result_gen;
+END_RCPP
+}
+// Array__offset
+int Array__offset(const std::shared_ptr<arrow::Array>& x);
+RcppExport SEXP _arrow_Array__offset(SEXP xSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::Array>& >::type x(xSEXP);
+    rcpp_result_gen = Rcpp::wrap(Array__offset(x));
+    return rcpp_result_gen;
+END_RCPP
+}
+// Array__null_count
+int Array__null_count(const std::shared_ptr<arrow::Array>& x);
+RcppExport SEXP _arrow_Array__null_count(SEXP xSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::Array>& >::type x(xSEXP);
+    rcpp_result_gen = Rcpp::wrap(Array__null_count(x));
+    return rcpp_result_gen;
+END_RCPP
+}
+// Array__type
+std::shared_ptr<arrow::DataType> Array__type(const std::shared_ptr<arrow::Array>& x);
+RcppExport SEXP _arrow_Array__type(SEXP xSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::Array>& >::type x(xSEXP);
+    rcpp_result_gen = Rcpp::wrap(Array__type(x));
+    return rcpp_result_gen;
+END_RCPP
+}
+// Array__ToString
+std::string Array__ToString(const std::shared_ptr<arrow::Array>& x);
+RcppExport SEXP _arrow_Array__ToString(SEXP xSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::Array>& >::type x(xSEXP);
+    rcpp_result_gen = Rcpp::wrap(Array__ToString(x));
+    return rcpp_result_gen;
+END_RCPP
+}
+// Array__type_id
+arrow::Type::type Array__type_id(const std::shared_ptr<arrow::Array>& x);
+RcppExport SEXP _arrow_Array__type_id(SEXP xSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::Array>& >::type x(xSEXP);
+    rcpp_result_gen = Rcpp::wrap(Array__type_id(x));
+    return rcpp_result_gen;
+END_RCPP
+}
+// Array__Equals
+bool Array__Equals(const std::shared_ptr<arrow::Array>& lhs, const std::shared_ptr<arrow::Array>& rhs);
+RcppExport SEXP _arrow_Array__Equals(SEXP lhsSEXP, SEXP rhsSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::Array>& >::type lhs(lhsSEXP);
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::Array>& >::type rhs(rhsSEXP);
+    rcpp_result_gen = Rcpp::wrap(Array__Equals(lhs, rhs));
+    return rcpp_result_gen;
+END_RCPP
+}
+// Array__ApproxEquals
+bool Array__ApproxEquals(const std::shared_ptr<arrow::Array>& lhs, const std::shared_ptr<arrow::Array>& rhs);
+RcppExport SEXP _arrow_Array__ApproxEquals(SEXP lhsSEXP, SEXP rhsSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::Array>& >::type lhs(lhsSEXP);
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::Array>& >::type rhs(rhsSEXP);
+    rcpp_result_gen = Rcpp::wrap(Array__ApproxEquals(lhs, rhs));
+    return rcpp_result_gen;
+END_RCPP
+}
+// Array__data
+std::shared_ptr<arrow::ArrayData> Array__data(const std::shared_ptr<arrow::Array>& array);
+RcppExport SEXP _arrow_Array__data(SEXP arraySEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::Array>& >::type array(arraySEXP);
+    rcpp_result_gen = Rcpp::wrap(Array__data(array));
+    return rcpp_result_gen;
+END_RCPP
+}
+// Array__RangeEquals
+bool Array__RangeEquals(const std::shared_ptr<arrow::Array>& self, const std::shared_ptr<arrow::Array>& other, int start_idx, int end_idx, int other_start_idx);
+RcppExport SEXP _arrow_Array__RangeEquals(SEXP selfSEXP, SEXP otherSEXP, SEXP start_idxSEXP, SEXP end_idxSEXP, SEXP other_start_idxSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::Array>& >::type self(selfSEXP);
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::Array>& >::type other(otherSEXP);
+    Rcpp::traits::input_parameter< int >::type start_idx(start_idxSEXP);
+    Rcpp::traits::input_parameter< int >::type end_idx(end_idxSEXP);
+    Rcpp::traits::input_parameter< int >::type other_start_idx(other_start_idxSEXP);
+    rcpp_result_gen = Rcpp::wrap(Array__RangeEquals(self, other, start_idx, end_idx, other_start_idx));
+    return rcpp_result_gen;
+END_RCPP
+}
+// Array__Mask
+LogicalVector Array__Mask(const std::shared_ptr<arrow::Array>& array);
+RcppExport SEXP _arrow_Array__Mask(SEXP arraySEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::Array>& >::type array(arraySEXP);
+    rcpp_result_gen = Rcpp::wrap(Array__Mask(array));
+    return rcpp_result_gen;
+END_RCPP
+}
+// ArrayData__get_type
+std::shared_ptr<arrow::DataType> ArrayData__get_type(const std::shared_ptr<arrow::ArrayData>& x);
+RcppExport SEXP _arrow_ArrayData__get_type(SEXP xSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::ArrayData>& >::type x(xSEXP);
+    rcpp_result_gen = Rcpp::wrap(ArrayData__get_type(x));
+    return rcpp_result_gen;
+END_RCPP
+}
+// ArrayData__get_length
+int ArrayData__get_length(const std::shared_ptr<arrow::ArrayData>& x);
+RcppExport SEXP _arrow_ArrayData__get_length(SEXP xSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::ArrayData>& >::type x(xSEXP);
+    rcpp_result_gen = Rcpp::wrap(ArrayData__get_length(x));
+    return rcpp_result_gen;
+END_RCPP
+}
+// ArrayData__get_null_count
+int ArrayData__get_null_count(const std::shared_ptr<arrow::ArrayData>& x);
+RcppExport SEXP _arrow_ArrayData__get_null_count(SEXP xSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::ArrayData>& >::type x(xSEXP);
+    rcpp_result_gen = Rcpp::wrap(ArrayData__get_null_count(x));
+    return rcpp_result_gen;
+END_RCPP
+}
+// ArrayData__get_offset
+int ArrayData__get_offset(const std::shared_ptr<arrow::ArrayData>& x);
+RcppExport SEXP _arrow_ArrayData__get_offset(SEXP xSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::ArrayData>& >::type x(xSEXP);
+    rcpp_result_gen = Rcpp::wrap(ArrayData__get_offset(x));
+    return rcpp_result_gen;
+END_RCPP
+}
+// ChunkedArray__length
+int ChunkedArray__length(const std::shared_ptr<arrow::ChunkedArray>& chunked_array);
+RcppExport SEXP _arrow_ChunkedArray__length(SEXP chunked_arraySEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::ChunkedArray>& >::type chunked_array(chunked_arraySEXP);
+    rcpp_result_gen = Rcpp::wrap(ChunkedArray__length(chunked_array));
+    return rcpp_result_gen;
+END_RCPP
+}
+// ChunkedArray__null_count
+int ChunkedArray__null_count(const std::shared_ptr<arrow::ChunkedArray>& chunked_array);
+RcppExport SEXP _arrow_ChunkedArray__null_count(SEXP chunked_arraySEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::ChunkedArray>& >::type chunked_array(chunked_arraySEXP);
+    rcpp_result_gen = Rcpp::wrap(ChunkedArray__null_count(chunked_array));
+    return rcpp_result_gen;
+END_RCPP
+}
+// ChunkedArray__num_chunks
+int ChunkedArray__num_chunks(const std::shared_ptr<arrow::ChunkedArray>& chunked_array);
+RcppExport SEXP _arrow_ChunkedArray__num_chunks(SEXP chunked_arraySEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::ChunkedArray>& >::type chunked_array(chunked_arraySEXP);
+    rcpp_result_gen = Rcpp::wrap(ChunkedArray__num_chunks(chunked_array));
+    return rcpp_result_gen;
+END_RCPP
+}
+// ChunkedArray__chunk
+std::shared_ptr<arrow::Array> ChunkedArray__chunk(const std::shared_ptr<arrow::ChunkedArray>& chunked_array, int i);
+RcppExport SEXP _arrow_ChunkedArray__chunk(SEXP chunked_arraySEXP, SEXP iSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::ChunkedArray>& >::type chunked_array(chunked_arraySEXP);
+    Rcpp::traits::input_parameter< int >::type i(iSEXP);
+    rcpp_result_gen = Rcpp::wrap(ChunkedArray__chunk(chunked_array, i));
+    return rcpp_result_gen;
+END_RCPP
+}
+// ChunkedArray__chunks
+List ChunkedArray__chunks(const std::shared_ptr<arrow::ChunkedArray>& chunked_array);
+RcppExport SEXP _arrow_ChunkedArray__chunks(SEXP chunked_arraySEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::ChunkedArray>& >::type chunked_array(chunked_arraySEXP);
+    rcpp_result_gen = Rcpp::wrap(ChunkedArray__chunks(chunked_array));
+    return rcpp_result_gen;
+END_RCPP
+}
+// ChunkedArray__type
+std::shared_ptr<arrow::DataType> ChunkedArray__type(const std::shared_ptr<arrow::ChunkedArray>& chunked_array);
+RcppExport SEXP _arrow_ChunkedArray__type(SEXP chunked_arraySEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::ChunkedArray>& >::type chunked_array(chunked_arraySEXP);
+    rcpp_result_gen = Rcpp::wrap(ChunkedArray__type(chunked_array));
+    return rcpp_result_gen;
+END_RCPP
+}
+// ChunkedArray__as_vector
+SEXP ChunkedArray__as_vector(const std::shared_ptr<arrow::ChunkedArray>& chunked_array);
+RcppExport SEXP _arrow_ChunkedArray__as_vector(SEXP chunked_arraySEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::ChunkedArray>& >::type chunked_array(chunked_arraySEXP);
+    rcpp_result_gen = Rcpp::wrap(ChunkedArray__as_vector(chunked_array));
+    return rcpp_result_gen;
+END_RCPP
+}
+// ChunkArray__Slice1
+std::shared_ptr<arrow::ChunkedArray> ChunkArray__Slice1(const std::shared_ptr<arrow::ChunkedArray>& chunked_array, int offset);
+RcppExport SEXP _arrow_ChunkArray__Slice1(SEXP chunked_arraySEXP, SEXP offsetSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::ChunkedArray>& >::type chunked_array(chunked_arraySEXP);
+    Rcpp::traits::input_parameter< int >::type offset(offsetSEXP);
+    rcpp_result_gen = Rcpp::wrap(ChunkArray__Slice1(chunked_array, offset));
+    return rcpp_result_gen;
+END_RCPP
+}
+// ChunkArray__Slice2
+std::shared_ptr<arrow::ChunkedArray> ChunkArray__Slice2(const std::shared_ptr<arrow::ChunkedArray>& chunked_array, int offset, int length);
+RcppExport SEXP _arrow_ChunkArray__Slice2(SEXP chunked_arraySEXP, SEXP offsetSEXP, SEXP lengthSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::ChunkedArray>& >::type chunked_array(chunked_arraySEXP);
+    Rcpp::traits::input_parameter< int >::type offset(offsetSEXP);
+    Rcpp::traits::input_parameter< int >::type length(lengthSEXP);
+    rcpp_result_gen = Rcpp::wrap(ChunkArray__Slice2(chunked_array, offset, length));
+    return rcpp_result_gen;
+END_RCPP
+}
+// ChunkedArray__from_list
+std::shared_ptr<arrow::ChunkedArray> ChunkedArray__from_list(List chunks);
+RcppExport SEXP _arrow_ChunkedArray__from_list(SEXP chunksSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< List >::type chunks(chunksSEXP);
+    rcpp_result_gen = Rcpp::wrap(ChunkedArray__from_list(chunks));
+    return rcpp_result_gen;
+END_RCPP
+}
+// Column__length
+int Column__length(const std::shared_ptr<arrow::Column>& column);
+RcppExport SEXP _arrow_Column__length(SEXP columnSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::Column>& >::type column(columnSEXP);
+    rcpp_result_gen = Rcpp::wrap(Column__length(column));
+    return rcpp_result_gen;
+END_RCPP
+}
+// Column__null_count
+int Column__null_count(const std::shared_ptr<arrow::Column>& column);
+RcppExport SEXP _arrow_Column__null_count(SEXP columnSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::Column>& >::type column(columnSEXP);
+    rcpp_result_gen = Rcpp::wrap(Column__null_count(column));
+    return rcpp_result_gen;
+END_RCPP
+}
+// Column__type
+std::shared_ptr<arrow::DataType> Column__type(const std::shared_ptr<arrow::Column>& column);
+RcppExport SEXP _arrow_Column__type(SEXP columnSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::Column>& >::type column(columnSEXP);
+    rcpp_result_gen = Rcpp::wrap(Column__type(column));
+    return rcpp_result_gen;
+END_RCPP
+}
+// Column__data
+std::shared_ptr<arrow::ChunkedArray> Column__data(const std::shared_ptr<arrow::Column>& column);
+RcppExport SEXP _arrow_Column__data(SEXP columnSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::Column>& >::type column(columnSEXP);
+    rcpp_result_gen = Rcpp::wrap(Column__data(column));
+    return rcpp_result_gen;
+END_RCPP
+}
+// Int8__initialize
+std::shared_ptr<arrow::DataType> Int8__initialize();
+RcppExport SEXP _arrow_Int8__initialize() {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    rcpp_result_gen = Rcpp::wrap(Int8__initialize());
+    return rcpp_result_gen;
+END_RCPP
+}
+// Int16__initialize
+std::shared_ptr<arrow::DataType> Int16__initialize();
+RcppExport SEXP _arrow_Int16__initialize() {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    rcpp_result_gen = Rcpp::wrap(Int16__initialize());
+    return rcpp_result_gen;
+END_RCPP
+}
+// Int32__initialize
+std::shared_ptr<arrow::DataType> Int32__initialize();
+RcppExport SEXP _arrow_Int32__initialize() {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    rcpp_result_gen = Rcpp::wrap(Int32__initialize());
+    return rcpp_result_gen;
+END_RCPP
+}
+// Int64__initialize
+std::shared_ptr<arrow::DataType> Int64__initialize();
+RcppExport SEXP _arrow_Int64__initialize() {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    rcpp_result_gen = Rcpp::wrap(Int64__initialize());
+    return rcpp_result_gen;
+END_RCPP
+}
+// UInt8__initialize
+std::shared_ptr<arrow::DataType> UInt8__initialize();
+RcppExport SEXP _arrow_UInt8__initialize() {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    rcpp_result_gen = Rcpp::wrap(UInt8__initialize());
+    return rcpp_result_gen;
+END_RCPP
+}
+// UInt16__initialize
+std::shared_ptr<arrow::DataType> UInt16__initialize();
+RcppExport SEXP _arrow_UInt16__initialize() {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    rcpp_result_gen = Rcpp::wrap(UInt16__initialize());
+    return rcpp_result_gen;
+END_RCPP
+}
+// UInt32__initialize
+std::shared_ptr<arrow::DataType> UInt32__initialize();
+RcppExport SEXP _arrow_UInt32__initialize() {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    rcpp_result_gen = Rcpp::wrap(UInt32__initialize());
+    return rcpp_result_gen;
+END_RCPP
+}
+// UInt64__initialize
+std::shared_ptr<arrow::DataType> UInt64__initialize();
+RcppExport SEXP _arrow_UInt64__initialize() {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    rcpp_result_gen = Rcpp::wrap(UInt64__initialize());
+    return rcpp_result_gen;
+END_RCPP
+}
+// Float16__initialize
+std::shared_ptr<arrow::DataType> Float16__initialize();
+RcppExport SEXP _arrow_Float16__initialize() {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    rcpp_result_gen = Rcpp::wrap(Float16__initialize());
+    return rcpp_result_gen;
+END_RCPP
+}
+// Float32__initialize
+std::shared_ptr<arrow::DataType> Float32__initialize();
+RcppExport SEXP _arrow_Float32__initialize() {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    rcpp_result_gen = Rcpp::wrap(Float32__initialize());
+    return rcpp_result_gen;
+END_RCPP
+}
+// Float64__initialize
+std::shared_ptr<arrow::DataType> Float64__initialize();
+RcppExport SEXP _arrow_Float64__initialize() {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    rcpp_result_gen = Rcpp::wrap(Float64__initialize());
+    return rcpp_result_gen;
+END_RCPP
+}
+// Boolean__initialize
+std::shared_ptr<arrow::DataType> Boolean__initialize();
+RcppExport SEXP _arrow_Boolean__initialize() {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    rcpp_result_gen = Rcpp::wrap(Boolean__initialize());
+    return rcpp_result_gen;
+END_RCPP
+}
+// Utf8__initialize
+std::shared_ptr<arrow::DataType> Utf8__initialize();
+RcppExport SEXP _arrow_Utf8__initialize() {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    rcpp_result_gen = Rcpp::wrap(Utf8__initialize());
+    return rcpp_result_gen;
+END_RCPP
+}
+// Date32__initialize
+std::shared_ptr<arrow::DataType> Date32__initialize();
+RcppExport SEXP _arrow_Date32__initialize() {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    rcpp_result_gen = Rcpp::wrap(Date32__initialize());
+    return rcpp_result_gen;
+END_RCPP
+}
+// Date64__initialize
+std::shared_ptr<arrow::DataType> Date64__initialize();
+RcppExport SEXP _arrow_Date64__initialize() {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    rcpp_result_gen = Rcpp::wrap(Date64__initialize());
+    return rcpp_result_gen;
+END_RCPP
+}
+// Null__initialize
+std::shared_ptr<arrow::DataType> Null__initialize();
+RcppExport SEXP _arrow_Null__initialize() {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    rcpp_result_gen = Rcpp::wrap(Null__initialize());
+    return rcpp_result_gen;
+END_RCPP
+}
+// Decimal128Type__initialize
+std::shared_ptr<arrow::DataType> Decimal128Type__initialize(int32_t precision, int32_t scale);
+RcppExport SEXP _arrow_Decimal128Type__initialize(SEXP precisionSEXP, SEXP scaleSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< int32_t >::type precision(precisionSEXP);
+    Rcpp::traits::input_parameter< int32_t >::type scale(scaleSEXP);
+    rcpp_result_gen = Rcpp::wrap(Decimal128Type__initialize(precision, scale));
+    return rcpp_result_gen;
+END_RCPP
+}
+// FixedSizeBinary__initialize
+std::shared_ptr<arrow::DataType> FixedSizeBinary__initialize(int32_t byte_width);
+RcppExport SEXP _arrow_FixedSizeBinary__initialize(SEXP byte_widthSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< int32_t >::type byte_width(byte_widthSEXP);
+    rcpp_result_gen = Rcpp::wrap(FixedSizeBinary__initialize(byte_width));
+    return rcpp_result_gen;
+END_RCPP
+}
+// Timestamp__initialize1
+std::shared_ptr<arrow::DataType> Timestamp__initialize1(arrow::TimeUnit::type unit);
+RcppExport SEXP _arrow_Timestamp__initialize1(SEXP unitSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< arrow::TimeUnit::type >::type unit(unitSEXP);
+    rcpp_result_gen = Rcpp::wrap(Timestamp__initialize1(unit));
+    return rcpp_result_gen;
+END_RCPP
+}
+// Timestamp__initialize2
+std::shared_ptr<arrow::DataType> Timestamp__initialize2(arrow::TimeUnit::type unit, const std::string& timezone);
+RcppExport SEXP _arrow_Timestamp__initialize2(SEXP unitSEXP, SEXP timezoneSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< arrow::TimeUnit::type >::type unit(unitSEXP);
+    Rcpp::traits::input_parameter< const std::string& >::type timezone(timezoneSEXP);
+    rcpp_result_gen = Rcpp::wrap(Timestamp__initialize2(unit, timezone));
+    return rcpp_result_gen;
+END_RCPP
+}
+// Time32__initialize
+std::shared_ptr<arrow::DataType> Time32__initialize(arrow::TimeUnit::type unit);
+RcppExport SEXP _arrow_Time32__initialize(SEXP unitSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< arrow::TimeUnit::type >::type unit(unitSEXP);
+    rcpp_result_gen = Rcpp::wrap(Time32__initialize(unit));
+    return rcpp_result_gen;
+END_RCPP
+}
+// Time64__initialize
+std::shared_ptr<arrow::DataType> Time64__initialize(arrow::TimeUnit::type unit);
+RcppExport SEXP _arrow_Time64__initialize(SEXP unitSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< arrow::TimeUnit::type >::type unit(unitSEXP);
+    rcpp_result_gen = Rcpp::wrap(Time64__initialize(unit));
+    return rcpp_result_gen;
+END_RCPP
+}
+// list__
+SEXP list__(SEXP x);
+RcppExport SEXP _arrow_list__(SEXP xSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< SEXP >::type x(xSEXP);
+    rcpp_result_gen = Rcpp::wrap(list__(x));
+    return rcpp_result_gen;
+END_RCPP
+}
+// struct_
+std::shared_ptr<arrow::DataType> struct_(List fields);
+RcppExport SEXP _arrow_struct_(SEXP fieldsSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< List >::type fields(fieldsSEXP);
+    rcpp_result_gen = Rcpp::wrap(struct_(fields));
+    return rcpp_result_gen;
+END_RCPP
+}
+// DataType__ToString
+std::string DataType__ToString(const std::shared_ptr<arrow::DataType>& type);
+RcppExport SEXP _arrow_DataType__ToString(SEXP typeSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::DataType>& >::type type(typeSEXP);
+    rcpp_result_gen = Rcpp::wrap(DataType__ToString(type));
+    return rcpp_result_gen;
+END_RCPP
+}
+// DataType__name
+std::string DataType__name(const std::shared_ptr<arrow::DataType>& type);
+RcppExport SEXP _arrow_DataType__name(SEXP typeSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::DataType>& >::type type(typeSEXP);
+    rcpp_result_gen = Rcpp::wrap(DataType__name(type));
+    return rcpp_result_gen;
+END_RCPP
+}
+// DataType__Equals
+bool DataType__Equals(const std::shared_ptr<arrow::DataType>& lhs, const std::shared_ptr<arrow::DataType>& rhs);
+RcppExport SEXP _arrow_DataType__Equals(SEXP lhsSEXP, SEXP rhsSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::DataType>& >::type lhs(lhsSEXP);
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::DataType>& >::type rhs(rhsSEXP);
+    rcpp_result_gen = Rcpp::wrap(DataType__Equals(lhs, rhs));
+    return rcpp_result_gen;
+END_RCPP
+}
+// DataType__num_children
+int DataType__num_children(const std::shared_ptr<arrow::DataType>& type);
+RcppExport SEXP _arrow_DataType__num_children(SEXP typeSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::DataType>& >::type type(typeSEXP);
+    rcpp_result_gen = Rcpp::wrap(DataType__num_children(type));
+    return rcpp_result_gen;
+END_RCPP
+}
+// DataType__children_pointer
+List DataType__children_pointer(const std::shared_ptr<arrow::DataType>& type);
+RcppExport SEXP _arrow_DataType__children_pointer(SEXP typeSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::DataType>& >::type type(typeSEXP);
+    rcpp_result_gen = Rcpp::wrap(DataType__children_pointer(type));
+    return rcpp_result_gen;
+END_RCPP
+}
+// DataType__id
+arrow::Type::type DataType__id(const std::shared_ptr<arrow::DataType>& type);
+RcppExport SEXP _arrow_DataType__id(SEXP typeSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::DataType>& >::type type(typeSEXP);
+    rcpp_result_gen = Rcpp::wrap(DataType__id(type));
+    return rcpp_result_gen;
+END_RCPP
+}
+// schema_
+std::shared_ptr<arrow::Schema> schema_(List fields);
+RcppExport SEXP _arrow_schema_(SEXP fieldsSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< List >::type fields(fieldsSEXP);
+    rcpp_result_gen = Rcpp::wrap(schema_(fields));
+    return rcpp_result_gen;
+END_RCPP
+}
+// Schema__ToString
+std::string Schema__ToString(const std::shared_ptr<arrow::Schema>& s);
+RcppExport SEXP _arrow_Schema__ToString(SEXP sSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::Schema>& >::type s(sSEXP);
+    rcpp_result_gen = Rcpp::wrap(Schema__ToString(s));
+    return rcpp_result_gen;
+END_RCPP
+}
+// ListType__ToString
+std::string ListType__ToString(const std::shared_ptr<arrow::ListType>& type);
+RcppExport SEXP _arrow_ListType__ToString(SEXP typeSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::ListType>& >::type type(typeSEXP);
+    rcpp_result_gen = Rcpp::wrap(ListType__ToString(type));
+    return rcpp_result_gen;
+END_RCPP
+}
+// FixedWidthType__bit_width
+int FixedWidthType__bit_width(const std::shared_ptr<arrow::FixedWidthType>& type);
+RcppExport SEXP _arrow_FixedWidthType__bit_width(SEXP typeSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::FixedWidthType>& >::type type(typeSEXP);
+    rcpp_result_gen = Rcpp::wrap(FixedWidthType__bit_width(type));
+    return rcpp_result_gen;
+END_RCPP
+}
+// DateType__unit
+arrow::DateUnit DateType__unit(const std::shared_ptr<arrow::DateType>& type);
+RcppExport SEXP _arrow_DateType__unit(SEXP typeSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::DateType>& >::type type(typeSEXP);
+    rcpp_result_gen = Rcpp::wrap(DateType__unit(type));
+    return rcpp_result_gen;
+END_RCPP
+}
+// TimeType__unit
+arrow::TimeUnit::type TimeType__unit(const std::shared_ptr<arrow::TimeType>& type);
+RcppExport SEXP _arrow_TimeType__unit(SEXP typeSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::TimeType>& >::type type(typeSEXP);
+    rcpp_result_gen = Rcpp::wrap(TimeType__unit(type));
+    return rcpp_result_gen;
+END_RCPP
+}
+// DecimalType__precision
+int32_t DecimalType__precision(const std::shared_ptr<arrow::DecimalType>& type);
+RcppExport SEXP _arrow_DecimalType__precision(SEXP typeSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::DecimalType>& >::type type(typeSEXP);
+    rcpp_result_gen = Rcpp::wrap(DecimalType__precision(type));
+    return rcpp_result_gen;
+END_RCPP
+}
+// DecimalType__scale
+int32_t DecimalType__scale(const std::shared_ptr<arrow::DecimalType>& type);
+RcppExport SEXP _arrow_DecimalType__scale(SEXP typeSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::DecimalType>& >::type type(typeSEXP);
+    rcpp_result_gen = Rcpp::wrap(DecimalType__scale(type));
+    return rcpp_result_gen;
+END_RCPP
+}
+// TimestampType__timezone
+std::string TimestampType__timezone(const std::shared_ptr<arrow::TimestampType>& type);
+RcppExport SEXP _arrow_TimestampType__timezone(SEXP typeSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::TimestampType>& >::type type(typeSEXP);
+    rcpp_result_gen = Rcpp::wrap(TimestampType__timezone(type));
+    return rcpp_result_gen;
+END_RCPP
+}
+// TimestampType__unit
+arrow::TimeUnit::type TimestampType__unit(const std::shared_ptr<arrow::TimestampType>& type);
+RcppExport SEXP _arrow_TimestampType__unit(SEXP typeSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::TimestampType>& >::type type(typeSEXP);
+    rcpp_result_gen = Rcpp::wrap(TimestampType__unit(type));
+    return rcpp_result_gen;
+END_RCPP
+}
+// Object__pointer_address
+std::string Object__pointer_address(SEXP obj);
+RcppExport SEXP _arrow_Object__pointer_address(SEXP objSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< SEXP >::type obj(objSEXP);
+    rcpp_result_gen = Rcpp::wrap(Object__pointer_address(obj));
+    return rcpp_result_gen;
+END_RCPP
+}
+// Field__initialize
+std::shared_ptr<arrow::Field> Field__initialize(const std::string& name, const std::shared_ptr<arrow::DataType>& type, bool nullable);
+RcppExport SEXP _arrow_Field__initialize(SEXP nameSEXP, SEXP typeSEXP, SEXP nullableSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::string& >::type name(nameSEXP);
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::DataType>& >::type type(typeSEXP);
+    Rcpp::traits::input_parameter< bool >::type nullable(nullableSEXP);
+    rcpp_result_gen = Rcpp::wrap(Field__initialize(name, type, nullable));
+    return rcpp_result_gen;
+END_RCPP
+}
+// Field__ToString
+std::string Field__ToString(const std::shared_ptr<arrow::Field>& type);
+RcppExport SEXP _arrow_Field__ToString(SEXP typeSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::Field>& >::type type(typeSEXP);
+    rcpp_result_gen = Rcpp::wrap(Field__ToString(type));
+    return rcpp_result_gen;
+END_RCPP
+}
+// Field__name
+std::string Field__name(std::shared_ptr<arrow::Field> type);
+RcppExport SEXP _arrow_Field__name(SEXP typeSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< std::shared_ptr<arrow::Field> >::type type(typeSEXP);
+    rcpp_result_gen = Rcpp::wrap(Field__name(type));
+    return rcpp_result_gen;
+END_RCPP
+}
+// Field__nullable
+bool Field__nullable(std::shared_ptr<arrow::Field> type);
+RcppExport SEXP _arrow_Field__nullable(SEXP typeSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< std::shared_ptr<arrow::Field> >::type type(typeSEXP);
+    rcpp_result_gen = Rcpp::wrap(Field__nullable(type));
+    return rcpp_result_gen;
+END_RCPP
+}
+// MemoryPool__default
+std::shared_ptr<arrow::MemoryPool> MemoryPool__default();
+RcppExport SEXP _arrow_MemoryPool__default() {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    rcpp_result_gen = Rcpp::wrap(MemoryPool__default());
+    return rcpp_result_gen;
+END_RCPP
+}
+// MemoryPool__bytes_allocated
+int MemoryPool__bytes_allocated(std::shared_ptr<arrow::MemoryPool> pool);
+RcppExport SEXP _arrow_MemoryPool__bytes_allocated(SEXP poolSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< std::shared_ptr<arrow::MemoryPool> >::type pool(poolSEXP);
+    rcpp_result_gen = Rcpp::wrap(MemoryPool__bytes_allocated(pool));
+    return rcpp_result_gen;
+END_RCPP
+}
+// MemoryPool__max_memory
+int MemoryPool__max_memory(std::shared_ptr<arrow::MemoryPool> pool);
+RcppExport SEXP _arrow_MemoryPool__max_memory(SEXP poolSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< std::shared_ptr<arrow::MemoryPool> >::type pool(poolSEXP);
+    rcpp_result_gen = Rcpp::wrap(MemoryPool__max_memory(pool));
+    return rcpp_result_gen;
+END_RCPP
+}
+// RecordBatch__num_columns
+int RecordBatch__num_columns(const std::shared_ptr<arrow::RecordBatch>& x);
+RcppExport SEXP _arrow_RecordBatch__num_columns(SEXP xSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::RecordBatch>& >::type x(xSEXP);
+    rcpp_result_gen = Rcpp::wrap(RecordBatch__num_columns(x));
+    return rcpp_result_gen;
+END_RCPP
+}
+// RecordBatch__num_rows
+int RecordBatch__num_rows(const std::shared_ptr<arrow::RecordBatch>& x);
+RcppExport SEXP _arrow_RecordBatch__num_rows(SEXP xSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::RecordBatch>& >::type x(xSEXP);
+    rcpp_result_gen = Rcpp::wrap(RecordBatch__num_rows(x));
+    return rcpp_result_gen;
+END_RCPP
+}
+// RecordBatch__schema
+std::shared_ptr<arrow::Schema> RecordBatch__schema(const std::shared_ptr<arrow::RecordBatch>& x);
+RcppExport SEXP _arrow_RecordBatch__schema(SEXP xSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::RecordBatch>& >::type x(xSEXP);
+    rcpp_result_gen = Rcpp::wrap(RecordBatch__schema(x));
+    return rcpp_result_gen;
+END_RCPP
+}
+// RecordBatch__column
+std::shared_ptr<arrow::Array> RecordBatch__column(const std::shared_ptr<arrow::RecordBatch>& batch, int i);
+RcppExport SEXP _arrow_RecordBatch__column(SEXP batchSEXP, SEXP iSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::RecordBatch>& >::type batch(batchSEXP);
+    Rcpp::traits::input_parameter< int >::type i(iSEXP);
+    rcpp_result_gen = Rcpp::wrap(RecordBatch__column(batch, i));
+    return rcpp_result_gen;
+END_RCPP
+}
+// RecordBatch__to_dataframe
+List RecordBatch__to_dataframe(const std::shared_ptr<arrow::RecordBatch>& batch);
+RcppExport SEXP _arrow_RecordBatch__to_dataframe(SEXP batchSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::RecordBatch>& >::type batch(batchSEXP);
+    rcpp_result_gen = Rcpp::wrap(RecordBatch__to_dataframe(batch));
+    return rcpp_result_gen;
+END_RCPP
+}
+// read_record_batch_
+std::shared_ptr<arrow::RecordBatch> read_record_batch_(std::string path);
+RcppExport SEXP _arrow_read_record_batch_(SEXP pathSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< std::string >::type path(pathSEXP);
+    rcpp_result_gen = Rcpp::wrap(read_record_batch_(path));
+    return rcpp_result_gen;
+END_RCPP
+}
+// RecordBatch__to_file
+int RecordBatch__to_file(const std::shared_ptr<arrow::RecordBatch>& batch, std::string path);
+RcppExport SEXP _arrow_RecordBatch__to_file(SEXP batchSEXP, SEXP pathSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::RecordBatch>& >::type batch(batchSEXP);
+    Rcpp::traits::input_parameter< std::string >::type path(pathSEXP);
+    rcpp_result_gen = Rcpp::wrap(RecordBatch__to_file(batch, path));
+    return rcpp_result_gen;
+END_RCPP
+}
+// RecordBatch__from_dataframe
+std::shared_ptr<arrow::RecordBatch> RecordBatch__from_dataframe(DataFrame tbl);
+RcppExport SEXP _arrow_RecordBatch__from_dataframe(SEXP tblSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< DataFrame >::type tbl(tblSEXP);
+    rcpp_result_gen = Rcpp::wrap(RecordBatch__from_dataframe(tbl));
+    return rcpp_result_gen;
+END_RCPP
+}
+// RecordBatch__Equals
+bool RecordBatch__Equals(const std::shared_ptr<arrow::RecordBatch>& self, const std::shared_ptr<arrow::RecordBatch>& other);
+RcppExport SEXP _arrow_RecordBatch__Equals(SEXP selfSEXP, SEXP otherSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::RecordBatch>& >::type self(selfSEXP);
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::RecordBatch>& >::type other(otherSEXP);
+    rcpp_result_gen = Rcpp::wrap(RecordBatch__Equals(self, other));
+    return rcpp_result_gen;
+END_RCPP
+}
+// RecordBatch__RemoveColumn
+std::shared_ptr<arrow::RecordBatch> RecordBatch__RemoveColumn(const std::shared_ptr<arrow::RecordBatch>& batch, int i);
+RcppExport SEXP _arrow_RecordBatch__RemoveColumn(SEXP batchSEXP, SEXP iSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::RecordBatch>& >::type batch(batchSEXP);
+    Rcpp::traits::input_parameter< int >::type i(iSEXP);
+    rcpp_result_gen = Rcpp::wrap(RecordBatch__RemoveColumn(batch, i));
+    return rcpp_result_gen;
+END_RCPP
+}
+// RecordBatch__column_name
+std::string RecordBatch__column_name(const std::shared_ptr<arrow::RecordBatch>& batch, int i);
+RcppExport SEXP _arrow_RecordBatch__column_name(SEXP batchSEXP, SEXP iSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::RecordBatch>& >::type batch(batchSEXP);
+    Rcpp::traits::input_parameter< int >::type i(iSEXP);
+    rcpp_result_gen = Rcpp::wrap(RecordBatch__column_name(batch, i));
+    return rcpp_result_gen;
+END_RCPP
+}
+// RecordBatch__names
+CharacterVector RecordBatch__names(const std::shared_ptr<arrow::RecordBatch>& batch);
+RcppExport SEXP _arrow_RecordBatch__names(SEXP batchSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::RecordBatch>& >::type batch(batchSEXP);
+    rcpp_result_gen = Rcpp::wrap(RecordBatch__names(batch));
+    return rcpp_result_gen;
+END_RCPP
+}
+// RecordBatch__Slice1
+std::shared_ptr<arrow::RecordBatch> RecordBatch__Slice1(std::shared_ptr<arrow::RecordBatch>& self, int offset);
+RcppExport SEXP _arrow_RecordBatch__Slice1(SEXP selfSEXP, SEXP offsetSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< std::shared_ptr<arrow::RecordBatch>& >::type self(selfSEXP);
+    Rcpp::traits::input_parameter< int >::type offset(offsetSEXP);
+    rcpp_result_gen = Rcpp::wrap(RecordBatch__Slice1(self, offset));
+    return rcpp_result_gen;
+END_RCPP
+}
+// RecordBatch__Slice2
+std::shared_ptr<arrow::RecordBatch> RecordBatch__Slice2(std::shared_ptr<arrow::RecordBatch>& self, int offset, int length);
+RcppExport SEXP _arrow_RecordBatch__Slice2(SEXP selfSEXP, SEXP offsetSEXP, SEXP lengthSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< std::shared_ptr<arrow::RecordBatch>& >::type self(selfSEXP);
+    Rcpp::traits::input_parameter< int >::type offset(offsetSEXP);
+    Rcpp::traits::input_parameter< int >::type length(lengthSEXP);
+    rcpp_result_gen = Rcpp::wrap(RecordBatch__Slice2(self, offset, length));
+    return rcpp_result_gen;
+END_RCPP
+}
+// Table__from_dataframe
+std::shared_ptr<arrow::Table> Table__from_dataframe(DataFrame tbl);
+RcppExport SEXP _arrow_Table__from_dataframe(SEXP tblSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< DataFrame >::type tbl(tblSEXP);
+    rcpp_result_gen = Rcpp::wrap(Table__from_dataframe(tbl));
+    return rcpp_result_gen;
+END_RCPP
+}
+// Table__num_columns
+int Table__num_columns(const std::shared_ptr<arrow::Table>& x);
+RcppExport SEXP _arrow_Table__num_columns(SEXP xSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::Table>& >::type x(xSEXP);
+    rcpp_result_gen = Rcpp::wrap(Table__num_columns(x));
+    return rcpp_result_gen;
+END_RCPP
+}
+// Table__num_rows
+int Table__num_rows(const std::shared_ptr<arrow::Table>& x);
+RcppExport SEXP _arrow_Table__num_rows(SEXP xSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::Table>& >::type x(xSEXP);
+    rcpp_result_gen = Rcpp::wrap(Table__num_rows(x));
+    return rcpp_result_gen;
+END_RCPP
+}
+// Table__schema
+std::shared_ptr<arrow::Schema> Table__schema(const std::shared_ptr<arrow::Table>& x);
+RcppExport SEXP _arrow_Table__schema(SEXP xSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::Table>& >::type x(xSEXP);
+    rcpp_result_gen = Rcpp::wrap(Table__schema(x));
+    return rcpp_result_gen;
+END_RCPP
+}
+// Table__to_file
+int Table__to_file(const std::shared_ptr<arrow::Table>& table, std::string path);
+RcppExport SEXP _arrow_Table__to_file(SEXP tableSEXP, SEXP pathSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::Table>& >::type table(tableSEXP);
+    Rcpp::traits::input_parameter< std::string >::type path(pathSEXP);
+    rcpp_result_gen = Rcpp::wrap(Table__to_file(table, path));
+    return rcpp_result_gen;
+END_RCPP
+}
+// read_table_
+std::shared_ptr<arrow::Table> read_table_(std::string path);
+RcppExport SEXP _arrow_read_table_(SEXP pathSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< std::string >::type path(pathSEXP);
+    rcpp_result_gen = Rcpp::wrap(read_table_(path));
+    return rcpp_result_gen;
+END_RCPP
+}
+// Table__to_dataframe
+List Table__to_dataframe(const std::shared_ptr<arrow::Table>& table);
+RcppExport SEXP _arrow_Table__to_dataframe(SEXP tableSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::Table>& >::type table(tableSEXP);
+    rcpp_result_gen = Rcpp::wrap(Table__to_dataframe(table));
+    return rcpp_result_gen;
+END_RCPP
+}
+// Table__column
+std::shared_ptr<arrow::Column> Table__column(const std::shared_ptr<arrow::Table>& table, int i);
+RcppExport SEXP _arrow_Table__column(SEXP tableSEXP, SEXP iSEXP) {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    Rcpp::traits::input_parameter< const std::shared_ptr<arrow::Table>& >::type table(tableSEXP);
+    Rcpp::traits::input_parameter< int >::type i(iSEXP);
+    rcpp_result_gen = Rcpp::wrap(Table__column(table, i));
     return rcpp_result_gen;
 END_RCPP
 }
 
 static const R_CallMethodDef CallEntries[] = {
-    {"_arrow_ping_arrow", (DL_FUNC) &_arrow_ping_arrow, 0},
+    {"_arrow_Array__from_vector", (DL_FUNC) &_arrow_Array__from_vector, 1},
+    {"_arrow_Array__as_vector", (DL_FUNC) &_arrow_Array__as_vector, 1},
+    {"_arrow_Array__Slice1", (DL_FUNC) &_arrow_Array__Slice1, 2},
+    {"_arrow_Array__Slice2", (DL_FUNC) &_arrow_Array__Slice2, 3},
+    {"_arrow_Array__IsNull", (DL_FUNC) &_arrow_Array__IsNull, 2},
+    {"_arrow_Array__IsValid", (DL_FUNC) &_arrow_Array__IsValid, 2},
+    {"_arrow_Array__length", (DL_FUNC) &_arrow_Array__length, 1},
+    {"_arrow_Array__offset", (DL_FUNC) &_arrow_Array__offset, 1},
+    {"_arrow_Array__null_count", (DL_FUNC) &_arrow_Array__null_count, 1},
+    {"_arrow_Array__type", (DL_FUNC) &_arrow_Array__type, 1},
+    {"_arrow_Array__ToString", (DL_FUNC) &_arrow_Array__ToString, 1},
+    {"_arrow_Array__type_id", (DL_FUNC) &_arrow_Array__type_id, 1},
+    {"_arrow_Array__Equals", (DL_FUNC) &_arrow_Array__Equals, 2},
+    {"_arrow_Array__ApproxEquals", (DL_FUNC) &_arrow_Array__ApproxEquals, 2},
+    {"_arrow_Array__data", (DL_FUNC) &_arrow_Array__data, 1},
+    {"_arrow_Array__RangeEquals", (DL_FUNC) &_arrow_Array__RangeEquals, 5},
+    {"_arrow_Array__Mask", (DL_FUNC) &_arrow_Array__Mask, 1},
+    {"_arrow_ArrayData__get_type", (DL_FUNC) &_arrow_ArrayData__get_type, 1},
+    {"_arrow_ArrayData__get_length", (DL_FUNC) &_arrow_ArrayData__get_length, 1},
+    {"_arrow_ArrayData__get_null_count", (DL_FUNC) &_arrow_ArrayData__get_null_count, 1},
+    {"_arrow_ArrayData__get_offset", (DL_FUNC) &_arrow_ArrayData__get_offset, 1},
+    {"_arrow_ChunkedArray__length", (DL_FUNC) &_arrow_ChunkedArray__length, 1},
+    {"_arrow_ChunkedArray__null_count", (DL_FUNC) &_arrow_ChunkedArray__null_count, 1},
+    {"_arrow_ChunkedArray__num_chunks", (DL_FUNC) &_arrow_ChunkedArray__num_chunks, 1},
+    {"_arrow_ChunkedArray__chunk", (DL_FUNC) &_arrow_ChunkedArray__chunk, 2},
+    {"_arrow_ChunkedArray__chunks", (DL_FUNC) &_arrow_ChunkedArray__chunks, 1},
+    {"_arrow_ChunkedArray__type", (DL_FUNC) &_arrow_ChunkedArray__type, 1},
+    {"_arrow_ChunkedArray__as_vector", (DL_FUNC) &_arrow_ChunkedArray__as_vector, 1},
+    {"_arrow_ChunkArray__Slice1", (DL_FUNC) &_arrow_ChunkArray__Slice1, 2},
+    {"_arrow_ChunkArray__Slice2", (DL_FUNC) &_arrow_ChunkArray__Slice2, 3},
+    {"_arrow_ChunkedArray__from_list", (DL_FUNC) &_arrow_ChunkedArray__from_list, 1},
+    {"_arrow_Column__length", (DL_FUNC) &_arrow_Column__length, 1},
+    {"_arrow_Column__null_count", (DL_FUNC) &_arrow_Column__null_count, 1},
+    {"_arrow_Column__type", (DL_FUNC) &_arrow_Column__type, 1},
+    {"_arrow_Column__data", (DL_FUNC) &_arrow_Column__data, 1},
+    {"_arrow_Int8__initialize", (DL_FUNC) &_arrow_Int8__initialize, 0},
+    {"_arrow_Int16__initialize", (DL_FUNC) &_arrow_Int16__initialize, 0},
+    {"_arrow_Int32__initialize", (DL_FUNC) &_arrow_Int32__initialize, 0},
+    {"_arrow_Int64__initialize", (DL_FUNC) &_arrow_Int64__initialize, 0},
+    {"_arrow_UInt8__initialize", (DL_FUNC) &_arrow_UInt8__initialize, 0},
+    {"_arrow_UInt16__initialize", (DL_FUNC) &_arrow_UInt16__initialize, 0},
+    {"_arrow_UInt32__initialize", (DL_FUNC) &_arrow_UInt32__initialize, 0},
+    {"_arrow_UInt64__initialize", (DL_FUNC) &_arrow_UInt64__initialize, 0},
+    {"_arrow_Float16__initialize", (DL_FUNC) &_arrow_Float16__initialize, 0},
+    {"_arrow_Float32__initialize", (DL_FUNC) &_arrow_Float32__initialize, 0},
+    {"_arrow_Float64__initialize", (DL_FUNC) &_arrow_Float64__initialize, 0},
+    {"_arrow_Boolean__initialize", (DL_FUNC) &_arrow_Boolean__initialize, 0},
+    {"_arrow_Utf8__initialize", (DL_FUNC) &_arrow_Utf8__initialize, 0},
+    {"_arrow_Date32__initialize", (DL_FUNC) &_arrow_Date32__initialize, 0},
+    {"_arrow_Date64__initialize", (DL_FUNC) &_arrow_Date64__initialize, 0},
+    {"_arrow_Null__initialize", (DL_FUNC) &_arrow_Null__initialize, 0},
+    {"_arrow_Decimal128Type__initialize", (DL_FUNC) &_arrow_Decimal128Type__initialize, 2},
+    {"_arrow_FixedSizeBinary__initialize", (DL_FUNC) &_arrow_FixedSizeBinary__initialize, 1},
+    {"_arrow_Timestamp__initialize1", (DL_FUNC) &_arrow_Timestamp__initialize1, 1},
+    {"_arrow_Timestamp__initialize2", (DL_FUNC) &_arrow_Timestamp__initialize2, 2},
+    {"_arrow_Time32__initialize", (DL_FUNC) &_arrow_Time32__initialize, 1},
+    {"_arrow_Time64__initialize", (DL_FUNC) &_arrow_Time64__initialize, 1},
+    {"_arrow_list__", (DL_FUNC) &_arrow_list__, 1},
+    {"_arrow_struct_", (DL_FUNC) &_arrow_struct_, 1},
+    {"_arrow_DataType__ToString", (DL_FUNC) &_arrow_DataType__ToString, 1},
+    {"_arrow_DataType__name", (DL_FUNC) &_arrow_DataType__name, 1},
+    {"_arrow_DataType__Equals", (DL_FUNC) &_arrow_DataType__Equals, 2},
+    {"_arrow_DataType__num_children", (DL_FUNC) &_arrow_DataType__num_children, 1},
+    {"_arrow_DataType__children_pointer", (DL_FUNC) &_arrow_DataType__children_pointer, 1},
+    {"_arrow_DataType__id", (DL_FUNC) &_arrow_DataType__id, 1},
+    {"_arrow_schema_", (DL_FUNC) &_arrow_schema_, 1},
+    {"_arrow_Schema__ToString", (DL_FUNC) &_arrow_Schema__ToString, 1},
+    {"_arrow_ListType__ToString", (DL_FUNC) &_arrow_ListType__ToString, 1},
+    {"_arrow_FixedWidthType__bit_width", (DL_FUNC) &_arrow_FixedWidthType__bit_width, 1},
+    {"_arrow_DateType__unit", (DL_FUNC) &_arrow_DateType__unit, 1},
+    {"_arrow_TimeType__unit", (DL_FUNC) &_arrow_TimeType__unit, 1},
+    {"_arrow_DecimalType__precision", (DL_FUNC) &_arrow_DecimalType__precision, 1},
+    {"_arrow_DecimalType__scale", (DL_FUNC) &_arrow_DecimalType__scale, 1},
+    {"_arrow_TimestampType__timezone", (DL_FUNC) &_arrow_TimestampType__timezone, 1},
+    {"_arrow_TimestampType__unit", (DL_FUNC) &_arrow_TimestampType__unit, 1},
+    {"_arrow_Object__pointer_address", (DL_FUNC) &_arrow_Object__pointer_address, 1},
+    {"_arrow_Field__initialize", (DL_FUNC) &_arrow_Field__initialize, 3},
+    {"_arrow_Field__ToString", (DL_FUNC) &_arrow_Field__ToString, 1},
+    {"_arrow_Field__name", (DL_FUNC) &_arrow_Field__name, 1},
+    {"_arrow_Field__nullable", (DL_FUNC) &_arrow_Field__nullable, 1},
+    {"_arrow_MemoryPool__default", (DL_FUNC) &_arrow_MemoryPool__default, 0},
+    {"_arrow_MemoryPool__bytes_allocated", (DL_FUNC) &_arrow_MemoryPool__bytes_allocated, 1},
+    {"_arrow_MemoryPool__max_memory", (DL_FUNC) &_arrow_MemoryPool__max_memory, 1},
+    {"_arrow_RecordBatch__num_columns", (DL_FUNC) &_arrow_RecordBatch__num_columns, 1},
+    {"_arrow_RecordBatch__num_rows", (DL_FUNC) &_arrow_RecordBatch__num_rows, 1},
+    {"_arrow_RecordBatch__schema", (DL_FUNC) &_arrow_RecordBatch__schema, 1},
+    {"_arrow_RecordBatch__column", (DL_FUNC) &_arrow_RecordBatch__column, 2},
+    {"_arrow_RecordBatch__to_dataframe", (DL_FUNC) &_arrow_RecordBatch__to_dataframe, 1},
+    {"_arrow_read_record_batch_", (DL_FUNC) &_arrow_read_record_batch_, 1},
+    {"_arrow_RecordBatch__to_file", (DL_FUNC) &_arrow_RecordBatch__to_file, 2},
+    {"_arrow_RecordBatch__from_dataframe", (DL_FUNC) &_arrow_RecordBatch__from_dataframe, 1},
+    {"_arrow_RecordBatch__Equals", (DL_FUNC) &_arrow_RecordBatch__Equals, 2},
+    {"_arrow_RecordBatch__RemoveColumn", (DL_FUNC) &_arrow_RecordBatch__RemoveColumn, 2},
+    {"_arrow_RecordBatch__column_name", (DL_FUNC) &_arrow_RecordBatch__column_name, 2},
+    {"_arrow_RecordBatch__names", (DL_FUNC) &_arrow_RecordBatch__names, 1},
+    {"_arrow_RecordBatch__Slice1", (DL_FUNC) &_arrow_RecordBatch__Slice1, 2},
+    {"_arrow_RecordBatch__Slice2", (DL_FUNC) &_arrow_RecordBatch__Slice2, 3},
+    {"_arrow_Table__from_dataframe", (DL_FUNC) &_arrow_Table__from_dataframe, 1},
+    {"_arrow_Table__num_columns", (DL_FUNC) &_arrow_Table__num_columns, 1},
+    {"_arrow_Table__num_rows", (DL_FUNC) &_arrow_Table__num_rows, 1},
+    {"_arrow_Table__schema", (DL_FUNC) &_arrow_Table__schema, 1},
+    {"_arrow_Table__to_file", (DL_FUNC) &_arrow_Table__to_file, 2},
+    {"_arrow_read_table_", (DL_FUNC) &_arrow_read_table_, 1},
+    {"_arrow_Table__to_dataframe", (DL_FUNC) &_arrow_Table__to_dataframe, 1},
+    {"_arrow_Table__column", (DL_FUNC) &_arrow_Table__column, 2},
     {NULL, NULL, 0}
 };
 
diff --git a/r/src/RecordBatch.cpp b/r/src/RecordBatch.cpp
new file mode 100644
index 0000000..cfcd2b1
--- /dev/null
+++ b/r/src/RecordBatch.cpp
@@ -0,0 +1,145 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "arrow_types.h"
+#include <arrow/io/file.h>
+#include <arrow/ipc/writer.h>
+#include <arrow/ipc/reader.h>
+
+using namespace Rcpp;
+using namespace arrow;
+
+// [[Rcpp::export]]
+int RecordBatch__num_columns(const std::shared_ptr<arrow::RecordBatch>& x){
+  return x->num_columns();
+}
+
+// [[Rcpp::export]]
+int RecordBatch__num_rows(const std::shared_ptr<arrow::RecordBatch>& x){
+  return x->num_rows();
+}
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::Schema> RecordBatch__schema(const std::shared_ptr<arrow::RecordBatch>& x){
+  return x->schema();
+}
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::Array> RecordBatch__column(const std::shared_ptr<arrow::RecordBatch>& batch, int i){
+  return batch->column(i);
+}
+
+// [[Rcpp::export]]
+List RecordBatch__to_dataframe(const std::shared_ptr<arrow::RecordBatch>& batch){
+  int nc = batch->num_columns();
+  int nr = batch->num_rows();
+  List tbl(nc);
+  CharacterVector names(nc);
+  for(int i=0; i<nc; i++) {
+    tbl[i] = Array__as_vector(batch->column(i));
+    names[i] = batch->column_name(i);
+  }
+  tbl.attr("names") = names;
+  tbl.attr("class") = CharacterVector::create("tbl_df", "tbl", "data.frame");
+  tbl.attr("row.names") = IntegerVector::create(NA_INTEGER, -nr);
+  return tbl;
+}
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::RecordBatch> read_record_batch_(std::string path) {
+  std::shared_ptr<arrow::io::ReadableFile> stream;
+  std::shared_ptr<arrow::ipc::RecordBatchFileReader> rbf_reader;
+
+  R_ERROR_NOT_OK(arrow::io::ReadableFile::Open(path, &stream));
+  R_ERROR_NOT_OK(arrow::ipc::RecordBatchFileReader::Open(stream, &rbf_reader));
+
+  std::shared_ptr<arrow::RecordBatch> batch;
+  R_ERROR_NOT_OK(rbf_reader->ReadRecordBatch(0, &batch));
+
+  R_ERROR_NOT_OK(stream->Close());
+  return batch;
+}
+
+// [[Rcpp::export]]
+int RecordBatch__to_file(const std::shared_ptr<arrow::RecordBatch>& batch, std::string path) {
+  std::shared_ptr<arrow::io::OutputStream> stream;
+  std::shared_ptr<arrow::ipc::RecordBatchWriter> file_writer;
+
+  R_ERROR_NOT_OK(arrow::io::FileOutputStream::Open(path, &stream));
+  R_ERROR_NOT_OK(arrow::ipc::RecordBatchFileWriter::Open(stream.get(), batch->schema(), &file_writer));
+  R_ERROR_NOT_OK(file_writer->WriteRecordBatch(*batch, true));
+  R_ERROR_NOT_OK(file_writer->Close());
+
+  int64_t offset;
+  R_ERROR_NOT_OK(stream->Tell(&offset));
+  R_ERROR_NOT_OK(stream->Close());
+  return offset;
+}
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::RecordBatch> RecordBatch__from_dataframe(DataFrame tbl){
+  CharacterVector names = tbl.names();
+
+  std::vector<std::shared_ptr<arrow::Field>> fields;
+  std::vector<std::shared_ptr<arrow::Array>> arrays;
+
+  int nc = tbl.size();
+  for(int i=0; i<tbl.size(); i++){
+    arrays.push_back(Array__from_vector(tbl[i]));
+    fields.push_back(std::make_shared<arrow::Field>(std::string(names[i]), arrays[i]->type()));
+  }
+  auto schema = std::make_shared<arrow::Schema>(std::move(fields));
+
+  return arrow::RecordBatch::Make(schema, tbl.nrow(), std::move(arrays));
+}
+
+// [[Rcpp::export]]
+bool RecordBatch__Equals(const std::shared_ptr<arrow::RecordBatch>& self, const std::shared_ptr<arrow::RecordBatch>& other) {
+  return self->Equals(*other);
+}
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::RecordBatch> RecordBatch__RemoveColumn(const std::shared_ptr<arrow::RecordBatch>& batch, int i) {
+  std::shared_ptr<arrow::RecordBatch> res;
+  R_ERROR_NOT_OK(batch->RemoveColumn(i, &res));
+  return res;
+}
+
+// [[Rcpp::export]]
+std::string RecordBatch__column_name(const std::shared_ptr<arrow::RecordBatch>& batch, int i) {
+  return batch->column_name(i);
+}
+
+// [[Rcpp::export]]
+CharacterVector RecordBatch__names(const std::shared_ptr<arrow::RecordBatch>& batch) {
+  int n = batch->num_columns();
+  CharacterVector names(n);
+  for (int i=0; i<n; i++) {
+    names[i] = batch->column_name(i);
+  }
+  return names;
+}
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::RecordBatch> RecordBatch__Slice1(std::shared_ptr<arrow::RecordBatch>& self, int offset) {
+  return self->Slice(offset);
+}
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::RecordBatch> RecordBatch__Slice2(std::shared_ptr<arrow::RecordBatch>& self, int offset, int length) {
+  return self->Slice(offset, length);
+}
diff --git a/r/src/Table.cpp b/r/src/Table.cpp
new file mode 100644
index 0000000..5917818
--- /dev/null
+++ b/r/src/Table.cpp
@@ -0,0 +1,106 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "arrow_types.h"
+#include <arrow/io/file.h>
+#include <arrow/ipc/writer.h>
+#include <arrow/ipc/reader.h>
+
+using namespace Rcpp;
+using namespace arrow;
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::Table> Table__from_dataframe(DataFrame tbl){
+  auto rb = RecordBatch__from_dataframe(tbl);
+
+  std::shared_ptr<arrow::Table> out;
+  R_ERROR_NOT_OK(arrow::Table::FromRecordBatches({ std::move(rb) }, &out));
+  return out;
+}
+
+// [[Rcpp::export]]
+int Table__num_columns(const std::shared_ptr<arrow::Table>& x){
+  return x->num_columns();
+}
+
+// [[Rcpp::export]]
+int Table__num_rows(const std::shared_ptr<arrow::Table>& x){
+  return x->num_rows();
+}
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::Schema> Table__schema(const std::shared_ptr<arrow::Table>& x){
+  return x->schema();
+}
+
+// [[Rcpp::export]]
+int Table__to_file(const std::shared_ptr<arrow::Table>& table, std::string path) {
+  std::shared_ptr<arrow::io::OutputStream> stream;
+  std::shared_ptr<arrow::ipc::RecordBatchWriter> file_writer;
+
+  R_ERROR_NOT_OK(arrow::io::FileOutputStream::Open(path, &stream));
+  R_ERROR_NOT_OK(arrow::ipc::RecordBatchFileWriter::Open(stream.get(), table->schema(), &file_writer));
+  R_ERROR_NOT_OK(file_writer->WriteTable(*table));
+  R_ERROR_NOT_OK(file_writer->Close());
+
+  int64_t offset;
+  R_ERROR_NOT_OK(stream->Tell(&offset));
+  R_ERROR_NOT_OK(stream->Close());
+  return offset;
+}
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::Table> read_table_(std::string path) {
+  std::shared_ptr<arrow::io::ReadableFile> stream;
+  std::shared_ptr<arrow::ipc::RecordBatchFileReader> rbf_reader;
+
+  R_ERROR_NOT_OK(arrow::io::ReadableFile::Open(path, &stream));
+  R_ERROR_NOT_OK(arrow::ipc::RecordBatchFileReader::Open(stream, &rbf_reader));
+
+  int num_batches = rbf_reader->num_record_batches();
+  std::vector<std::shared_ptr<arrow::RecordBatch>> batches(num_batches);
+  for (int i=0; i<num_batches; i++) {
+    R_ERROR_NOT_OK(rbf_reader->ReadRecordBatch(i, &batches[i]));
+  }
+
+  std::shared_ptr<arrow::Table> table;
+  R_ERROR_NOT_OK(arrow::Table::FromRecordBatches(std::move(batches), &table)) ;
+  R_ERROR_NOT_OK(stream->Close());
+  return table;
+}
+
+// [[Rcpp::export]]
+List Table__to_dataframe(const std::shared_ptr<arrow::Table>& table){
+  int nc = table->num_columns();
+  int nr = table->num_rows();
+  List tbl(nc);
+  CharacterVector names(nc);
+  for(int i=0; i<nc; i++) {
+    auto column = table->column(i);
+    tbl[i] = ChunkedArray__as_vector(column->data());
+    names[i] = column->name();
+  }
+  tbl.attr("names") = names;
+  tbl.attr("class") = CharacterVector::create("tbl_df", "tbl", "data.frame");
+  tbl.attr("row.names") = IntegerVector::create(NA_INTEGER, -nr);
+  return tbl;
+}
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::Column> Table__column(const std::shared_ptr<arrow::Table>& table, int i) {
+  return table->column(i);
+}
diff --git a/r/src/array.cpp b/r/src/array.cpp
new file mode 100644
index 0000000..3a6b60e
--- /dev/null
+++ b/r/src/array.cpp
@@ -0,0 +1,238 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "arrow_types.h"
+
+using namespace Rcpp;
+using namespace arrow;
+
+namespace arrow{
+namespace r{
+
+template <int RTYPE, typename Vec = Rcpp::Vector<RTYPE> >
+class SimpleRBuffer : public arrow::Buffer {
+public:
+
+  SimpleRBuffer(Vec vec) :
+    Buffer(reinterpret_cast<const uint8_t*>(vec.begin()), vec.size() * sizeof(typename Vec::stored_type)),
+    vec_(vec)
+  {}
+
+private:
+  // vec_ holds the memory
+  Vec vec_;
+};
+
+template <int RTYPE, typename Type>
+std::shared_ptr<arrow::Array> SimpleArray(SEXP x){
+  Rcpp::Vector<RTYPE> vec(x);
+  std::vector<std::shared_ptr<arrow::Buffer>> buffers {
+    nullptr,
+    std::make_shared<SimpleRBuffer<RTYPE>>(vec)
+  };
+
+  int null_count = 0;
+  if (RTYPE != RAWSXP) {
+    std::shared_ptr<arrow::Buffer> null_bitmap;
+
+    auto first_na = std::find_if(vec.begin(), vec.end(), Rcpp::Vector<RTYPE>::is_na);
+    if (first_na < vec.end()) {
+      R_ERROR_NOT_OK(arrow::AllocateBuffer(vec.size(), &null_bitmap));
+      auto null_bitmap_data = null_bitmap->mutable_data();
+      arrow::internal::FirstTimeBitmapWriter bitmap_writer(null_bitmap_data, 0, vec.size());
+
+      // first loop to clear all the bits before the first NA
+      auto j = std::distance(vec.begin(), first_na);
+      int i = 0;
+      for( ; i < j; i++, bitmap_writer.Next()) {
+        bitmap_writer.Set();
+      }
+
+      // then finish
+      for( ; i < vec.size(); i++, bitmap_writer.Next()) {
+        if (Rcpp::Vector<RTYPE>::is_na(vec[i]) ) {
+          bitmap_writer.Clear();
+          null_count++;
+        } else {
+          bitmap_writer.Set();
+        }
+      }
+
+      bitmap_writer.Finish();
+      buffers[0] = std::move(null_bitmap);
+    }
+  }
+
+  auto data = ArrayData::Make(
+    std::make_shared<Type>(),
+    LENGTH(x),
+    std::move(buffers),
+    null_count,
+    0 /*offset*/
+  );
+
+  // return the right Array class
+  return std::make_shared<arrow::NumericArray<Type>>(data);
+}
+
+}
+}
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::Array> Array__from_vector(SEXP x){
+  switch(TYPEOF(x)){
+    case INTSXP:
+      if (Rf_isFactor(x)) {
+        break;
+      }
+    return arrow::r::SimpleArray<INTSXP, arrow::Int32Type>(x);
+    case REALSXP:
+      // TODO: Dates, ...
+    return arrow::r::SimpleArray<REALSXP, arrow::DoubleType>(x);
+    case RAWSXP:
+      return arrow::r::SimpleArray<RAWSXP, arrow::Int8Type>(x);
+    default:
+      break;
+  }
+
+  stop("not handled");
+  return nullptr;
+}
+
+
+template <int RTYPE>
+inline SEXP simple_Array_to_Vector(const std::shared_ptr<arrow::Array>& array ){
+  using stored_type = typename Rcpp::Vector<RTYPE>::stored_type;
+  auto start = reinterpret_cast<const stored_type*>(array->data()->buffers[1]->data() + array->offset() * sizeof(stored_type));
+
+  size_t n = array->length();
+  Rcpp::Vector<RTYPE> vec(start, start + n);
+  if (array->null_count() && RTYPE != RAWSXP) {
+    // TODO: not sure what to do with RAWSXP since
+    //       R raw vector do not have a concept of missing data
+
+    arrow::internal::BitmapReader bitmap_reader(
+        array->null_bitmap()->data(), array->offset(), n
+    );
+    for (size_t i=0; i < n; i++, bitmap_reader.Next()) {
+      if (bitmap_reader.IsNotSet()) {
+        vec[i] = Rcpp::Vector<RTYPE>::get_na();
+      }
+    }
+  }
+
+  return vec;
+}
+
+// [[Rcpp::export]]
+SEXP Array__as_vector(const std::shared_ptr<arrow::Array>& array){
+  switch(array->type_id()){
+  case Type::INT8: return simple_Array_to_Vector<RAWSXP>(array);
+  case Type::INT32: return simple_Array_to_Vector<INTSXP>(array);
+  case Type::DOUBLE: return simple_Array_to_Vector<REALSXP>(array);
+  default:
+    break;
+  }
+
+  stop(tfm::format("cannot handle Array of type %d", array->type_id()));
+  return R_NilValue;
+}
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::Array> Array__Slice1(const std::shared_ptr<arrow::Array>& array, int offset) {
+  return array->Slice(offset);
+}
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::Array> Array__Slice2(const std::shared_ptr<arrow::Array>& array, int offset, int length) {
+  return array->Slice(offset, length);
+}
+
+// [[Rcpp::export]]
+bool Array__IsNull(const std::shared_ptr<arrow::Array>& x, int i){
+  return x->IsNull(i);
+}
+
+// [[Rcpp::export]]
+bool Array__IsValid(const std::shared_ptr<arrow::Array>& x, int i){
+  return x->IsValid(i);
+}
+
+// [[Rcpp::export]]
+int Array__length(const std::shared_ptr<arrow::Array>& x){
+  return x->length();
+}
+
+// [[Rcpp::export]]
+int Array__offset(const std::shared_ptr<arrow::Array>& x){
+  return x->offset();
+}
+
+// [[Rcpp::export]]
+int Array__null_count(const std::shared_ptr<arrow::Array>& x){
+  return x->null_count();
+}
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::DataType> Array__type(const std::shared_ptr<arrow::Array>& x){
+  return x->type();
+}
+
+// [[Rcpp::export]]
+std::string Array__ToString(const std::shared_ptr<arrow::Array>& x){
+  return x->ToString();
+}
+
+// [[Rcpp::export]]
+arrow::Type::type Array__type_id(const std::shared_ptr<arrow::Array>& x){
+  return x->type_id();
+}
+
+// [[Rcpp::export]]
+bool Array__Equals(const std::shared_ptr<arrow::Array>& lhs, const std::shared_ptr<arrow::Array>& rhs){
+  return lhs->Equals(rhs);
+}
+
+// [[Rcpp::export]]
+bool Array__ApproxEquals(const std::shared_ptr<arrow::Array>& lhs, const std::shared_ptr<arrow::Array>& rhs){
+  return lhs->ApproxEquals(rhs);
+}
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::ArrayData> Array__data(const std::shared_ptr<arrow::Array>& array){
+  return array->data();
+}
+
+// [[Rcpp::export]]
+bool Array__RangeEquals(const std::shared_ptr<arrow::Array>& self, const std::shared_ptr<arrow::Array>&other, int start_idx, int end_idx, int other_start_idx) {
+  return self->RangeEquals(*other, start_idx, end_idx, other_start_idx);
+}
+
+// [[Rcpp::export]]
+LogicalVector Array__Mask(const std::shared_ptr<arrow::Array>& array) {
+  if (array->null_count() == 0) {
+    return LogicalVector(array->length(), true);
+  }
+
+  auto n = array->length();
+  LogicalVector res(no_init(n));
+  arrow::internal::BitmapReader bitmap_reader(array->null_bitmap()->data(), array->offset(), n);
+  for (size_t i=0; i < array->length(); i++, bitmap_reader.Next()) {
+    res[i] = bitmap_reader.IsSet();
+  }
+  return res;
+}
diff --git a/r/src/arrow_types.h b/r/src/arrow_types.h
new file mode 100644
index 0000000..66754ed
--- /dev/null
+++ b/r/src/arrow_types.h
@@ -0,0 +1,106 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#pragma once
+
+#include <RcppCommon.h>
+
+#undef Free
+#include <arrow/api.h>
+#include <arrow/type.h>
+
+#define R_ERROR_NOT_OK(s) do { if(!s.ok()) Rcpp::stop(s.ToString()); } while (0);
+
+template <typename T>
+struct NoDelete{
+  inline void operator()(T* ptr){};
+};
+
+namespace Rcpp{
+namespace traits{
+
+struct wrap_type_shared_ptr_tag{};
+struct wrap_type_static_ptr_tag{};
+
+template <typename T>
+struct wrap_type_traits<std::shared_ptr<T>>{
+  using wrap_category = wrap_type_shared_ptr_tag;
+};
+
+template <typename T>
+class Exporter<std::shared_ptr<T>>;
+
+}
+namespace internal{
+
+template <typename T>
+inline SEXP wrap_dispatch(const T& x, Rcpp::traits::wrap_type_shared_ptr_tag) ;
+
+template <typename T>
+inline SEXP wrap_dispatch(const T& x, Rcpp::traits::wrap_type_static_ptr_tag) ;
+
+}
+
+}
+
+#include <Rcpp.h>
+
+RCPP_EXPOSED_ENUM_NODECL(arrow::Type::type)
+RCPP_EXPOSED_ENUM_NODECL(arrow::DateUnit)
+RCPP_EXPOSED_ENUM_NODECL(arrow::TimeUnit::type)
+RCPP_EXPOSED_ENUM_NODECL(arrow::StatusCode)
+
+namespace Rcpp{
+namespace traits{
+
+template <typename T>
+class Exporter<std::shared_ptr<T>> {
+public:
+  Exporter(SEXP self) : xp(extract_xp(self)){}
+
+  inline std::shared_ptr<T> get(){
+    return *Rcpp::XPtr<std::shared_ptr<T>>(xp);
+  }
+
+private:
+  SEXP xp;
+
+  SEXP extract_xp(SEXP self){
+    static SEXP symb_xp = Rf_install(".:xp:.");
+    return Rf_findVarInFrame(self, symb_xp) ;
+  }
+
+};
+
+}
+
+namespace internal{
+
+template <typename T>
+inline SEXP wrap_dispatch(const T& x, Rcpp::traits::wrap_type_shared_ptr_tag){
+  return Rcpp::XPtr<std::shared_ptr<typename T::element_type>>(new std::shared_ptr<typename T::element_type>(x));
+}
+
+}
+
+}
+
+SEXP ChunkedArray__as_vector(const std::shared_ptr<arrow::ChunkedArray>& chunked_array);
+SEXP Array__as_vector(const std::shared_ptr<arrow::Array>& array);
+std::shared_ptr<arrow::Array> Array__from_vector(SEXP x);
+std::shared_ptr<arrow::RecordBatch> RecordBatch__from_dataframe(Rcpp::DataFrame tbl);
+
diff --git a/r/src/hello.cpp b/r/src/field.cpp
similarity index 57%
rename from r/src/hello.cpp
rename to r/src/field.cpp
index ddb512e..7ea96a3 100644
--- a/r/src/hello.cpp
+++ b/r/src/field.cpp
@@ -15,12 +15,28 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include "r_arrow_types.h"
+#include "arrow_types.h"
 
-using namespace Rcpp ;
-using namespace arrow ;
+// [[Rcpp::plugins(cpp11)]]
+
+using namespace Rcpp;
+
+// [[Rcpp::export]]
+std::shared_ptr<arrow::Field> Field__initialize(const std::string& name, const std::shared_ptr<arrow::DataType>& type, bool nullable = true) {
+  return arrow::field(name, type, nullable);
+}
+
+// [[Rcpp::export]]
+std::string Field__ToString(const std::shared_ptr<arrow::Field>& type) {
+  return type->ToString();
+}
+
+// [[Rcpp::export]]
+std::string Field__name(std::shared_ptr<arrow::Field> type) {
+  return type->name();
+}
 
 // [[Rcpp::export]]
-std::string ping_arrow(){
-  return arrow::int32()->name();
+bool Field__nullable(std::shared_ptr<arrow::Field> type) {
+  return type->nullable();
 }
diff --git a/r/tests/testthat.R b/r/tests/testthat.R
index cda8cf9..da5f1b1 100644
--- a/r/tests/testthat.R
+++ b/r/tests/testthat.R
@@ -17,5 +17,6 @@
 
 library(testthat)
 library(arrow)
+library(tibble)
 
 test_check("arrow")
diff --git a/r/tests/testthat/test-Array.R b/r/tests/testthat/test-Array.R
new file mode 100644
index 0000000..f747cae
--- /dev/null
+++ b/r/tests/testthat/test-Array.R
@@ -0,0 +1,66 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+context("arrow::Array")
+
+test_that("Array", {
+  x <- array(1:10, 1:10, 1:5)
+  expect_equal(x$type(), int32())
+  expect_equal(x$length(), 25L)
+  expect_equal(x$as_vector(), c(1:10, 1:10, 1:5))
+
+  y <- x$Slice(10)
+  expect_equal(y$type(), int32())
+  expect_equal(y$length(), 15L)
+  expect_equal(y$as_vector(), c(1:10, 1:5))
+  expect_true(x$RangeEquals(y, 10, 24, 0))
+
+  z <- x$Slice(10, 5)
+  expect_equal(z$type(), int32())
+  expect_equal(z$length(), 5L)
+  expect_equal(z$as_vector(), c(1:5))
+  expect_true(x$RangeEquals(z, 10, 15, 0))
+
+  x_dbl <- array(c(1,2,3), c(4,5,6))
+  expect_equal(x_dbl$type(), float64())
+  expect_equal(x_dbl$length(), 6L)
+  expect_equal(x_dbl$as_vector(), as.numeric(1:6))
+
+  y_dbl <- x_dbl$Slice(3)
+  expect_equal(y_dbl$type(), float64())
+  expect_equal(y_dbl$length(), 3L)
+  expect_equal(y_dbl$offset(), 3L)
+  expect_equal(y_dbl$as_vector(), as.numeric(4:6))
+
+  z_dbl <- x_dbl$Slice(3, 2)
+  expect_equal(z_dbl$type(), float64())
+  expect_equal(z_dbl$length(), 2L)
+  expect_equal(z_dbl$as_vector(), as.numeric(4:5))
+})
+
+test_that("Array supports NA", {
+  x_int <- array(as.integer(c(1:10, NA)))
+  x_dbl <- array(as.numeric(c(1:10, NA)))
+  expect_true(x_int$IsValid(0L))
+  expect_true(x_dbl$IsValid(0L))
+  expect_true(x_int$IsNull(10L))
+  expect_true(x_dbl$IsNull(10L))
+
+  # this is not part of Array api
+  expect_equal(Array__Mask(x_int), c(rep(TRUE, 10), FALSE))
+  expect_equal(Array__Mask(x_dbl), c(rep(TRUE, 10), FALSE))
+})
diff --git a/r/tests/testthat/test-DataType.R b/r/tests/testthat/test-DataType.R
new file mode 100644
index 0000000..e87175c
--- /dev/null
+++ b/r/tests/testthat/test-DataType.R
@@ -0,0 +1,314 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+context("arrow::DataType")
+
+test_that("null type works as expected",{
+  x <- null()
+  expect_equal(x$id(), 0L)
+  expect_equal(x$name(), "null")
+  expect_equal(x$ToString(), "null")
+  expect_true(x == x)
+  expect_false(x == int8())
+  expect_equal(x$num_children(), 0L)
+  expect_equal(x$children(), list())
+})
+
+test_that("boolean type work as expected",{
+  x <- boolean()
+  expect_equal(x$id(), 1L)
+  expect_equal(x$name(), "bool")
+  expect_equal(x$ToString(), "bool")
+  expect_true(x == x)
+  expect_false(x == null())
+  expect_equal(x$num_children(), 0L)
+  expect_equal(x$children(), list())
+  expect_equal(x$bit_width(), 1L)
+})
+
+test_that("int types works as expected",{
+  x <- uint8()
+  expect_equal(x$id(), 2L)
+  expect_equal(x$name(), "uint8")
+  expect_equal(x$ToString(), "uint8")
+  expect_true(x == x)
+  expect_false(x == null())
+  expect_equal(x$num_children(), 0L)
+  expect_equal(x$children(), list())
+  expect_equal(x$bit_width(), 8L)
+
+  x <- int8()
+  expect_equal(x$id(), 3L)
+  expect_equal(x$name(), "int8")
+  expect_equal(x$ToString(), "int8")
+  expect_true(x == x)
+  expect_false(x == null())
+  expect_equal(x$num_children(), 0L)
+  expect_equal(x$children(), list())
+  expect_equal(x$bit_width(), 8L)
+
+  x <- uint16()
+  expect_equal(x$id(), 4L)
+  expect_equal(x$name(), "uint16")
+  expect_equal(x$ToString(), "uint16")
+  expect_true(x == x)
+  expect_false(x == null())
+  expect_equal(x$num_children(), 0L)
+  expect_equal(x$children(), list())
+  expect_equal(x$bit_width(), 16L)
+
+  x <- int16()
+  expect_equal(x$id(), 5L)
+  expect_equal(x$name(), "int16")
+  expect_equal(x$ToString(), "int16")
+  expect_true(x == x)
+  expect_false(x == null())
+  expect_equal(x$num_children(), 0L)
+  expect_equal(x$children(), list())
+  expect_equal(x$bit_width(), 16L)
+
+  x <- uint32()
+  expect_equal(x$id(), 6L)
+  expect_equal(x$name(), "uint32")
+  expect_equal(x$ToString(), "uint32")
+  expect_true(x == x)
+  expect_false(x == null())
+  expect_equal(x$num_children(), 0L)
+  expect_equal(x$children(), list())
+  expect_equal(x$bit_width(), 32L)
+
+  x <- int32()
+  expect_equal(x$id(), 7L)
+  expect_equal(x$name(), "int32")
+  expect_equal(x$ToString(), "int32")
+  expect_true(x == x)
+  expect_false(x == null())
+  expect_equal(x$num_children(), 0L)
+  expect_equal(x$children(), list())
+  expect_equal(x$bit_width(), 32L)
+
+  x <- uint64()
+  expect_equal(x$id(), 8L)
+  expect_equal(x$name(), "uint64")
+  expect_equal(x$ToString(), "uint64")
+  expect_true(x == x)
+  expect_false(x == null())
+  expect_equal(x$num_children(), 0L)
+  expect_equal(x$children(), list())
+  expect_equal(x$bit_width(), 64L)
+
+  x <- int64()
+  expect_equal(x$id(), 9L)
+  expect_equal(x$name(), "int64")
+  expect_equal(x$ToString(), "int64")
+  expect_true(x == x)
+  expect_false(x == null())
+  expect_equal(x$num_children(), 0L)
+  expect_equal(x$children(), list())
+  expect_equal(x$bit_width(), 64L)
+})
+
+test_that("float types work as expected",{
+  x <- float16()
+  expect_equal(x$id(), 10L)
+  expect_equal(x$name(), "halffloat")
+  expect_equal(x$ToString(), "halffloat")
+  expect_true(x == x)
+  expect_false(x == null())
+  expect_equal(x$num_children(), 0L)
+  expect_equal(x$children(), list())
+  expect_equal(x$bit_width(), 16L)
+
+  x <- float32()
+  expect_equal(x$id(), 11L)
+  expect_equal(x$name(), "float")
+  expect_equal(x$ToString(), "float")
+  expect_true(x == x)
+  expect_false(x == null())
+  expect_equal(x$num_children(), 0L)
+  expect_equal(x$children(), list())
+  expect_equal(x$bit_width(), 32L)
+
+  x <- float64()
+  expect_equal(x$id(), 12L)
+  expect_equal(x$name(), "double")
+  expect_equal(x$ToString(), "double")
+  expect_true(x == x)
+  expect_false(x == null())
+  expect_equal(x$num_children(), 0L)
+  expect_equal(x$children(), list())
+  expect_equal(x$bit_width(), 64L)
+})
+
+test_that("utf8 type works as expected",{
+  x <- utf8()
+  expect_equal(x$id(), 13L)
+  expect_equal(x$name(), "utf8")
+  expect_equal(x$ToString(), "string")
+  expect_true(x == x)
+  expect_false(x == null())
+  expect_equal(x$num_children(), 0L)
+  expect_equal(x$children(), list())
+})
+
+test_that("date types work as expected", {
+  x <- date32()
+  expect_equal(x$id(), 16L)
+  expect_equal(x$name(), "date32")
+  expect_equal(x$ToString(), "date32[day]")
+  expect_true(x == x)
+  expect_false(x == null())
+  expect_equal(x$num_children(), 0L)
+  expect_equal(x$children(), list())
+  expect_equal(x$unit(), unclass(DateUnit$DAY))
+
+  x <- date64()
+  expect_equal(x$id(), 17L)
+  expect_equal(x$name(), "date64")
+  expect_equal(x$ToString(), "date64[ms]")
+  expect_true(x == x)
+  expect_false(x == null())
+  expect_equal(x$num_children(), 0L)
+  expect_equal(x$children(), list())
+  expect_equal(x$unit(), unclass(DateUnit$MILLI))
+})
+
+test_that("timestamp type works as expected", {
+  x <- timestamp(TimeUnit$SECOND)
+  expect_equal(x$id(), 18L)
+  expect_equal(x$name(), "timestamp")
+  expect_equal(x$ToString(), "timestamp[s]")
+  expect_true(x == x)
+  expect_false(x == null())
+  expect_equal(x$num_children(), 0L)
+  expect_equal(x$children(), list())
+  expect_equal(x$bit_width(), 64L)
+  expect_equal(x$timezone(), "")
+  expect_equal(x$unit(), unclass(TimeUnit$SECOND))
+
+  x <- timestamp(TimeUnit$MILLI)
+  expect_equal(x$id(), 18L)
+  expect_equal(x$name(), "timestamp")
+  expect_equal(x$ToString(), "timestamp[ms]")
+  expect_true(x == x)
+  expect_false(x == null())
+  expect_equal(x$num_children(), 0L)
+  expect_equal(x$children(), list())
+  expect_equal(x$bit_width(), 64L)
+  expect_equal(x$timezone(), "")
+  expect_equal(x$unit(), unclass(TimeUnit$MILLI))
+
+  x <- timestamp(TimeUnit$MICRO)
+  expect_equal(x$id(), 18L)
+  expect_equal(x$name(), "timestamp")
+  expect_equal(x$ToString(), "timestamp[us]")
+  expect_true(x == x)
+  expect_false(x == null())
+  expect_equal(x$num_children(), 0L)
+  expect_equal(x$children(), list())
+  expect_equal(x$bit_width(), 64L)
+  expect_equal(x$timezone(), "")
+  expect_equal(x$unit(), unclass(TimeUnit$MICRO))
+
+  x <- timestamp(TimeUnit$NANO)
+  expect_equal(x$id(), 18L)
+  expect_equal(x$name(), "timestamp")
+  expect_equal(x$ToString(), "timestamp[ns]")
+  expect_true(x == x)
+  expect_false(x == null())
+  expect_equal(x$num_children(), 0L)
+  expect_equal(x$children(), list())
+  expect_equal(x$bit_width(), 64L)
+  expect_equal(x$timezone(), "")
+  expect_equal(x$unit(), unclass(TimeUnit$NANO))
+})
+
+test_that("time32 types work as expected", {
+  x <- time32(TimeUnit$SECOND)
+  expect_equal(x$id(), 19L)
+  expect_equal(x$name(), "time32")
+  expect_equal(x$ToString(), "time32[s]")
+  expect_true(x == x)
+  expect_false(x == null())
+  expect_equal(x$num_children(), 0L)
+  expect_equal(x$children(), list())
+  expect_equal(x$bit_width(), 32L)
+  expect_equal(x$unit(), unclass(TimeUnit$SECOND))
+
+  x <- time32(TimeUnit$MILLI)
+  expect_equal(x$id(), 19L)
+  expect_equal(x$name(), "time32")
+  expect_equal(x$ToString(), "time32[ms]")
+  expect_true(x == x)
+  expect_false(x == null())
+  expect_equal(x$num_children(), 0L)
+  expect_equal(x$children(), list())
+  expect_equal(x$bit_width(), 32L)
+  expect_equal(x$unit(), unclass(TimeUnit$MILLI))
+})
+
+test_that("time64 types work as expected", {
+  x <- time64(TimeUnit$MICRO)
+  expect_equal(x$id(), 20L)
+  expect_equal(x$name(), "time64")
+  expect_equal(x$ToString(), "time64[us]")
+  expect_true(x == x)
+  expect_false(x == null())
+  expect_equal(x$num_children(), 0L)
+  expect_equal(x$children(), list())
+  expect_equal(x$bit_width(), 64L)
+  expect_equal(x$unit(), unclass(TimeUnit$MICRO))
+
+  x <- time64(TimeUnit$NANO)
+  expect_equal(x$id(), 20L)
+  expect_equal(x$name(), "time64")
+  expect_equal(x$ToString(), "time64[ns]")
+  expect_true(x == x)
+  expect_false(x == null())
+  expect_equal(x$num_children(), 0L)
+  expect_equal(x$children(), list())
+  expect_equal(x$bit_width(), 64L)
+  expect_equal(x$unit(), unclass(TimeUnit$NANO))
+})
+
+test_that("list type works as expected", {
+  x <- list_of(int32())
+  expect_equal(x$id(), 23L)
+  expect_equal(x$name(), "list")
+  expect_equal(x$ToString(), "list<item: int32>")
+  expect_true(x == x)
+  expect_false(x == null())
+  expect_equal(x$num_children(), 1L)
+  expect_equal(
+    x$children(),
+    list(field("item", int32()))
+  )
+})
+
+test_that("struct type works as expected", {
+  x <- struct(x = int32(), y = boolean())
+  expect_equal(x$id(), 24L)
+  expect_equal(x$name(), "struct")
+  expect_equal(x$ToString(), "struct<x: int32, y: bool>")
+  expect_true(x == x)
+  expect_false(x == null())
+  expect_equal(x$num_children(), 2L)
+  expect_equal(
+    x$children(),
+    list(field("x", int32()), field("y", boolean()))
+  )
+})
diff --git a/r/tests/testthat/test-RecordBatch.R b/r/tests/testthat/test-RecordBatch.R
new file mode 100644
index 0000000..71d645c
--- /dev/null
+++ b/r/tests/testthat/test-RecordBatch.R
@@ -0,0 +1,59 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+context("arrow::RecordBatch")
+
+test_that("RecordBatch", {
+  tbl <- tibble::tibble(int = 1:10, dbl = as.numeric(1:10))
+  batch <- record_batch(tbl)
+
+  expect_true(batch == batch)
+  expect_equal(
+    batch$schema(),
+    schema(int = int32(), dbl = float64())
+  )
+  expect_equal(batch$num_columns(), 2L)
+  expect_equal(batch$num_rows(), 10L)
+  expect_equal(batch$column_name(0), "int")
+  expect_equal(batch$column_name(1), "dbl")
+  expect_equal(names(batch), c("int", "dbl"))
+
+  col_int <- batch$column(0)
+  expect_true(inherits(col_int, 'arrow::Array'))
+  expect_equal(col_int$as_vector(), tbl$int)
+  expect_equal(col_int$type(), int32())
+
+  col_dbl <- batch$column(1)
+  expect_true(inherits(col_dbl, 'arrow::Array'))
+  expect_equal(col_dbl$as_vector(), tbl$dbl)
+  expect_equal(col_dbl$type(), float64())
+
+  batch2 <- batch$RemoveColumn(0)
+  expect_equal(
+    batch2$schema(),
+    schema(dbl = float64())
+  )
+  expect_equal(batch2$column(0), batch$column(1))
+
+  batch3 <- batch$Slice(5)
+  expect_equal(batch3$num_rows(), 5)
+  expect_equal(batch3$column(0)$as_vector(), 6:10)
+
+  batch4 <- batch$Slice(5, 2)
+  expect_equal(batch4$num_rows(), 2)
+  expect_equal(batch4$column(0)$as_vector(), 6:7)
+})
diff --git a/r/tests/testthat/test-chunkedarray.R b/r/tests/testthat/test-chunkedarray.R
new file mode 100644
index 0000000..09b062f
--- /dev/null
+++ b/r/tests/testthat/test-chunkedarray.R
@@ -0,0 +1,77 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+context("arrow::ChunkedArray")
+
+test_that("ChunkedArray", {
+  x <- chunked_array(1:10, 1:10, 1:5)
+  expect_equal(x$type(), int32())
+  expect_equal(x$num_chunks(), 3L)
+  expect_equal(x$length(), 25L)
+  expect_equal(x$as_vector(), c(1:10, 1:10, 1:5))
+
+  y <- x$Slice(8)
+  expect_equal(y$type(), int32())
+  expect_equal(y$num_chunks(), 3L)
+  expect_equal(y$length(), 17L)
+  expect_equal(y$as_vector(), c(9:10, 1:10, 1:5))
+
+  z <- x$Slice(8, 5)
+  expect_equal(z$type(), int32())
+  expect_equal(z$num_chunks(), 2L)
+  expect_equal(z$length(), 5L)
+  expect_equal(z$as_vector(), c(9:10, 1:3))
+
+  x_dbl <- chunked_array(c(1,2,3), c(4,5,6))
+  expect_equal(x_dbl$type(), float64())
+  expect_equal(x_dbl$num_chunks(), 2L)
+  expect_equal(x_dbl$length(), 6L)
+  expect_equal(x_dbl$as_vector(), as.numeric(1:6))
+
+  y_dbl <- x_dbl$Slice(2)
+  expect_equal(y_dbl$type(), float64())
+  expect_equal(y_dbl$num_chunks(), 2L)
+  expect_equal(y_dbl$length(), 4L)
+  expect_equal(y_dbl$as_vector(), as.numeric(3:6))
+
+  z_dbl <- x_dbl$Slice(2, 2)
+  expect_equal(z_dbl$type(), float64())
+  expect_equal(z_dbl$num_chunks(), 2L)
+  expect_equal(z_dbl$length(), 2L)
+  expect_equal(z_dbl$as_vector(), as.numeric(3:4))
+})
+
+test_that("ChunkedArray handles !!! splicing", {
+  data <- list(1, 2, 3)
+  x <- chunked_array(!!!data)
+  expect_equal(x$type(), float64())
+  expect_equal(x$num_chunks(), 3L)
+})
+
+test_that("ChunkedArray handles NA", {
+  data <- list(1:10, c(NA, 2:10), c(1:3, NA, 5L))
+  x <- chunked_array(!!!data)
+  expect_equal(x$type(), int32())
+  expect_equal(x$num_chunks(), 3L)
+  expect_equal(x$length(), 25L)
+  expect_equal(x$as_vector(), c(1:10, c(NA, 2:10), c(1:3, NA, 5)))
+
+  chunks <- x$chunks()
+  expect_equal(Array__Mask(chunks[[1]]), !is.na(data[[1]]))
+  expect_equal(Array__Mask(chunks[[2]]), !is.na(data[[2]]))
+  expect_equal(Array__Mask(chunks[[3]]), !is.na(data[[3]]))
+})
diff --git a/r/tests/testthat/test-read-write.R b/r/tests/testthat/test-read-write.R
new file mode 100644
index 0000000..c67fe72
--- /dev/null
+++ b/r/tests/testthat/test-read-write.R
@@ -0,0 +1,126 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+context("test-read-write")
+
+test_that("arrow::table round trip", {
+  tbl <- tibble::tibble(
+    int = 1:10,
+    dbl = as.numeric(1:10),
+    raw = as.raw(1:10)
+  )
+
+  tab <- arrow::table(tbl)
+  expect_equal(tab$num_columns(), 3L)
+  expect_equal(tab$num_rows(), 10L)
+
+  # arrow::Column
+  col_int <- tab$column(0)
+  expect_equal(col_int$length(), 10L)
+  expect_equal(col_int$null_count(), 0L)
+  expect_equal(col_int$type(), int32())
+
+  # arrow::ChunkedArray
+  chunked_array_int <- col_int$data()
+  expect_equal(chunked_array_int$length(), 10L)
+  expect_equal(chunked_array_int$null_count(), 0L)
+  expect_equal(chunked_array_int$as_vector(), tbl$int)
+
+  # arrow::Array
+  chunks_int <- chunked_array_int$chunks()
+  expect_equal(length(chunks_int), chunked_array_int$num_chunks())
+  for( i in seq_along(chunks_int)){
+    expect_equal(chunked_array_int$chunk(i-1L), chunks_int[[i]])
+  }
+
+  # arrow::Column
+  col_dbl <- tab$column(1)
+  expect_equal(col_dbl$length(), 10L)
+  expect_equal(col_dbl$null_count(), 0L)
+  expect_equal(col_dbl$type(), float64())
+
+  # arrow::ChunkedArray
+  chunked_array_dbl <- col_dbl$data()
+  expect_equal(chunked_array_dbl$length(), 10L)
+  expect_equal(chunked_array_dbl$null_count(), 0L)
+  expect_equal(chunked_array_dbl$as_vector(), tbl$dbl)
+
+  # arrow::Array
+  chunks_dbl <- chunked_array_dbl$chunks()
+  expect_equal(length(chunks_dbl), chunked_array_dbl$num_chunks())
+  for( i in seq_along(chunks_dbl)){
+    expect_equal(chunked_array_dbl$chunk(i-1L), chunks_dbl[[i]])
+  }
+
+  # arrow::Colmumn
+  col_raw <- tab$column(2)
+  expect_equal(col_raw$length(), 10L)
+  expect_equal(col_raw$null_count(), 0L)
+  expect_equal(col_raw$type(), int8())
+
+  # arrow::ChunkedArray
+  chunked_array_raw <- col_raw$data()
+  expect_equal(chunked_array_raw$length(), 10L)
+  expect_equal(chunked_array_raw$null_count(), 0L)
+  expect_equal(chunked_array_raw$as_vector(), tbl$raw)
+
+  # arrow::Array
+  chunks_raw <- chunked_array_raw$chunks()
+  expect_equal(length(chunks_raw), chunked_array_raw$num_chunks())
+  for( i in seq_along(chunks_raw)){
+    expect_equal(chunked_array_raw$chunk(i-1L), chunks_raw[[i]])
+  }
+  tf <- tempfile(); on.exit(unlink(tf))
+  write_arrow(tbl, path = tf)
+
+  res <- read_arrow(tf)
+  expect_identical(tbl, res)
+})
+
+test_that("arrow::table round trip handles NA in integer and numeric", {
+  tbl <- tibble::tibble(
+    int = c(NA, 2:10),
+    dbl = as.numeric(c(1:5, NA, 7:9, NA)),
+    raw = as.raw(1:10)
+  )
+
+  tab <- arrow::table(tbl)
+  expect_equal(tab$num_columns(), 3L)
+  expect_equal(tab$num_rows(), 10L)
+
+  expect_equal(tab$column(0)$length(), 10L)
+  expect_equal(tab$column(1)$length(), 10L)
+  expect_equal(tab$column(2)$length(), 10L)
+
+  expect_equal(tab$column(0)$null_count(), 1L)
+  expect_equal(tab$column(1)$null_count(), 2L)
+  expect_equal(tab$column(2)$null_count(), 0L)
+
+  expect_equal(tab$column(0)$type(), int32())
+  expect_equal(tab$column(1)$type(), float64())
+  expect_equal(tab$column(2)$type(), int8())
+
+  tf <- tempfile(); on.exit(unlink(tf))
+  write_arrow(tbl, path = tf)
+
+  res <- read_arrow(tf)
+  expect_identical(tbl, res)
+  expect_true(is.na(res$int[1]))
+  expect_true(is.na(res$dbl[6]))
+  expect_true(is.na(res$dbl[10]))
+})
+