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/07 21:54:22 UTC

[arrow] branch master updated: ARROW-1325: [R] Initial R package that builds against the arrow C++ library

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 e7b269d  ARROW-1325: [R] Initial R package that builds against the arrow C++ library
e7b269d is described below

commit e7b269de73b694c0d6cd7f2e56ac6a1a10c4cb22
Author: Romain Francois <ro...@purrple.cat>
AuthorDate: Fri Sep 7 17:54:14 2018 -0400

    ARROW-1325: [R] Initial R package that builds against the arrow C++ library
    
    This is very minimal in functionality, it just gives a simple R package that calls a function from the arrow C++ library.
    
    Author: Romain Francois <ro...@purrple.cat>
    Author: Wes McKinney <we...@apache.org>
    
    Closes #2489 from romainfrancois/r-bootstrap and squashes the following commits:
    
    89f14b4ba <Wes McKinney> Add license addendums
    9e3ffb4d2 <Romain Francois> skip using rpath linker option
    79c50011d <Romain Francois> follow up from @wesm comments on #2489
    a1a5e7c33 <Romain Francois> + installation instructions
    fb412ca1d <Romain Francois> not checking for headers on these files
    2848fd168 <Romain Francois> initial R :package: with travis setup and testthat suite, that links to arrow c++ library and calls arrow::int32()
---
 .gitignore                                  |  1 +
 .travis.yml                                 | 10 +++
 LICENSE.txt                                 | 24 +++++++
 ci/travis_env_common.sh                     |  1 +
 dev/release/rat_exclude_files.txt           |  9 +++
 r/.Rbuildignore                             |  3 +
 r/.gitignore                                | 10 +++
 r/DESCRIPTION                               | 21 +++++++
 r/NAMESPACE                                 |  4 ++
 r/R/RcppExports.R                           |  7 +++
 .gitignore => r/R/zzz.R                     | 26 +-------
 r/README.Rmd                                | 40 ++++++++++++
 r/README.md                                 | 29 +++++++++
 r/arrow.Rproj                               | 21 +++++++
 .gitignore => r/cleanup                     | 25 +-------
 r/configure                                 | 97 +++++++++++++++++++++++++++++
 r/src/.gitignore                            |  3 +
 .gitignore => r/src/Makevars.in             | 27 ++------
 r/src/RcppExports.cpp                       | 27 ++++++++
 r/src/hello.cpp                             | 26 ++++++++
 r/src/r_arrow_types.h                       | 22 +++++++
 .gitignore => r/tests/testthat.R            | 25 +-------
 .gitignore => r/tests/testthat/test-arrow.R | 26 ++------
 23 files changed, 372 insertions(+), 112 deletions(-)

diff --git a/.gitignore b/.gitignore
index ab51a6f..2a19b34 100644
--- a/.gitignore
+++ b/.gitignore
@@ -38,3 +38,4 @@ python/.eggs/
 .idea/
 .pytest_cache/
 pkgs
+.Rproj.user
diff --git a/.travis.yml b/.travis.yml
index 600fde4..f77e22d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -246,6 +246,16 @@ matrix:
     after_success:
     - pushd ${TRAVIS_BUILD_DIR}/go/arrow
     - bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"
+  # R
+  - language: r
+    cache: packages
+    latex: false
+    before_install:
+    - $TRAVIS_BUILD_DIR/ci/travis_install_linux.sh
+    - $TRAVIS_BUILD_DIR/ci/travis_before_script_cpp.sh --only-library
+    - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$TRAVIS_BUILD_DIR/cpp-install/lib
+    - export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$TRAVIS_BUILD_DIR/cpp-install/lib/pkgconfig
+    - pushd ${TRAVIS_BUILD_DIR}/r
 
 
 after_failure:
diff --git a/LICENSE.txt b/LICENSE.txt
index e557b80..08d692c 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -672,3 +672,27 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 SOFTWARE.
+
+--------------------------------------------------------------------------------
+
+The script r/configure has the following license (MIT)
+
+Copyright (c) 2017, Jeroen Ooms and Jim Hester
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/ci/travis_env_common.sh b/ci/travis_env_common.sh
index 78a8996..622a795 100755
--- a/ci/travis_env_common.sh
+++ b/ci/travis_env_common.sh
@@ -30,6 +30,7 @@ export ARROW_JS_DIR=${TRAVIS_BUILD_DIR}/js
 export ARROW_INTEGRATION_DIR=$TRAVIS_BUILD_DIR/integration
 export ARROW_RUBY_DIR=$TRAVIS_BUILD_DIR/ruby
 export ARROW_RUST_DIR=${TRAVIS_BUILD_DIR}/rust
+export ARROW_R_DIR=${TRAVIS_BUILD_DIR}/r
 
 if [ "$ARROW_TRAVIS_COVERAGE" == "1" ]; then
     export ARROW_CPP_COVERAGE_FILE=${TRAVIS_BUILD_DIR}/coverage.info
diff --git a/dev/release/rat_exclude_files.txt b/dev/release/rat_exclude_files.txt
index 6e450e5..0f358ac 100644
--- a/dev/release/rat_exclude_files.txt
+++ b/dev/release/rat_exclude_files.txt
@@ -116,3 +116,12 @@ c_glib/doc/reference/gtk-doc.make
 *.svg
 *.devhelp2
 *.scss
+r/R/RcppExports.R
+r/src/RcppExports.cpp
+r/DESCRIPTION
+r/LICENSE.md
+r/NAMESPACE
+r/.Rbuildignore
+r/arrow.Rproj
+r/README.md
+r/README.Rmd
diff --git a/r/.Rbuildignore b/r/.Rbuildignore
new file mode 100644
index 0000000..931662b
--- /dev/null
+++ b/r/.Rbuildignore
@@ -0,0 +1,3 @@
+^.*\.Rproj$
+^\.Rproj\.user$
+^README\.Rmd$
diff --git a/r/.gitignore b/r/.gitignore
new file mode 100644
index 0000000..85c9868
--- /dev/null
+++ b/r/.gitignore
@@ -0,0 +1,10 @@
+*.o
+*.o-*
+*.d
+*.so
+*.dll
+.RData
+.Rproj.user
+.Rhistory
+src/Makevars
+
diff --git a/r/DESCRIPTION b/r/DESCRIPTION
new file mode 100644
index 0000000..db9652e
--- /dev/null
+++ b/r/DESCRIPTION
@@ -0,0 +1,21 @@
+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("Apache Arrow", email = "dev@arrow.apache.org", role = c("aut", "cph"))
+  )
+Description: R Integration to 'Apache' 'Arrow'.
+Depends: R (>= 3.5)
+License: Apache License (>= 2.0)
+Encoding: UTF-8
+LazyData: true
+SystemRequirements: C++11
+LinkingTo: 
+    Rcpp
+Imports: 
+    Rcpp
+Roxygen: list(markdown = TRUE)
+RoxygenNote: 6.0.1.9000
+Suggests: 
+    testthat
diff --git a/r/NAMESPACE b/r/NAMESPACE
new file mode 100644
index 0000000..4bd43f4
--- /dev/null
+++ b/r/NAMESPACE
@@ -0,0 +1,4 @@
+# Generated by roxygen2: do not edit by hand
+
+importFrom(Rcpp,sourceCpp)
+useDynLib(arrow, .registration = TRUE)
diff --git a/r/R/RcppExports.R b/r/R/RcppExports.R
new file mode 100644
index 0000000..1439551
--- /dev/null
+++ b/r/R/RcppExports.R
@@ -0,0 +1,7 @@
+# Generated by using Rcpp::compileAttributes() -> do not edit by hand
+# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
+
+ping_arrow <- function() {
+    .Call(`_arrow_ping_arrow`)
+}
+
diff --git a/.gitignore b/r/R/zzz.R
similarity index 78%
copy from .gitignore
copy to r/R/zzz.R
index ab51a6f..be952a6 100644
--- a/.gitignore
+++ b/r/R/zzz.R
@@ -15,26 +15,6 @@
 # specific language governing permissions and limitations
 # under the License.
 
-# Compiled source
-*.a
-*.dll
-*.o
-*.py[ocd]
-*.so
-*.so.*
-*.dylib
-.build_cache_dir
-MANIFEST
-
-# Generated Visual Studio files
-*.vcxproj
-*.vcxproj.*
-*.sln
-*.iml
-
-cpp/.idea/
-python/.eggs/
-.vscode
-.idea/
-.pytest_cache/
-pkgs
+#' @useDynLib arrow, .registration = TRUE
+#' @importFrom Rcpp sourceCpp
+NULL
diff --git a/r/README.Rmd b/r/README.Rmd
new file mode 100644
index 0000000..db482da
--- /dev/null
+++ b/r/README.Rmd
@@ -0,0 +1,40 @@
+---
+output: github_document
+---
+
+<!-- README.md is generated from README.Rmd. Please edit that file -->
+
+```{r setup, include = FALSE}
+knitr::opts_chunk$set(
+  collapse = TRUE,
+  comment = "#>",
+  fig.path = "man/figures/README-",
+  out.width = "100%"
+)
+```
+# arrow
+
+R integration with Apache Arrow.
+
+## Installation
+
+First install a release build of the C++ bindings to arrow.
+
+```shell
+git clone https://github.com/apache/arrow.git
+cd arrow/cpp && mkdir release && cd release
+
+# It is important to statically link to boost libraries
+cmake .. -DCMAKE_BUILD_TYPE=Release -DARROW_BOOST_USE_SHARED:BOOL=Off
+make install
+```
+
+Then the R package: 
+
+```r
+devtools::install_github("apache/arrow/r")
+```
+
+## Example
+
+(not yet)
diff --git a/r/README.md b/r/README.md
new file mode 100644
index 0000000..0597006
--- /dev/null
+++ b/r/README.md
@@ -0,0 +1,29 @@
+
+<!-- README.md is generated from README.Rmd. Please edit that file -->
+
+# arrow
+
+R integration with Apache Arrow.
+
+## Installation
+
+First install a release build of the C++ bindings to arrow.
+
+``` shell
+git clone https://github.com/apache/arrow.git
+cd arrow/cpp && mkdir release && cd release
+
+# It is important to statically link to boost libraries
+cmake .. -DCMAKE_BUILD_TYPE=Release -DARROW_BOOST_USE_SHARED:BOOL=Off
+make install
+```
+
+Then the R package:
+
+``` r
+devtools::install_github("apache/arrow/r")
+```
+
+## Example
+
+(not yet)
diff --git a/r/arrow.Rproj b/r/arrow.Rproj
new file mode 100644
index 0000000..cba1b6b
--- /dev/null
+++ b/r/arrow.Rproj
@@ -0,0 +1,21 @@
+Version: 1.0
+
+RestoreWorkspace: No
+SaveWorkspace: No
+AlwaysSaveHistory: Default
+
+EnableCodeIndexing: Yes
+UseSpacesForTab: Yes
+NumSpacesForTab: 2
+Encoding: UTF-8
+
+RnwWeave: Sweave
+LaTeX: pdfLaTeX
+
+AutoAppendNewline: Yes
+StripTrailingWhitespace: Yes
+
+BuildType: Package
+PackageUseDevtools: Yes
+PackageInstallArgs: --no-multiarch --with-keep.source
+PackageRoxygenize: rd,collate,namespace
diff --git a/.gitignore b/r/cleanup
old mode 100644
new mode 100755
similarity index 78%
copy from .gitignore
copy to r/cleanup
index ab51a6f..ff031e9
--- a/.gitignore
+++ b/r/cleanup
@@ -1,3 +1,5 @@
+#!/bin/sh
+
 # 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
@@ -15,26 +17,5 @@
 # specific language governing permissions and limitations
 # under the License.
 
-# Compiled source
-*.a
-*.dll
-*.o
-*.py[ocd]
-*.so
-*.so.*
-*.dylib
-.build_cache_dir
-MANIFEST
-
-# Generated Visual Studio files
-*.vcxproj
-*.vcxproj.*
-*.sln
-*.iml
+rm -f src/Makevars
 
-cpp/.idea/
-python/.eggs/
-.vscode
-.idea/
-.pytest_cache/
-pkgs
diff --git a/r/configure b/r/configure
new file mode 100755
index 0000000..69f0463
--- /dev/null
+++ b/r/configure
@@ -0,0 +1,97 @@
+#!/bin/bash
+
+# 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.
+
+# Anticonf (tm) script by Jeroen Ooms, Jim Hester (2017)
+# License: MIT
+#
+# This script will query 'pkg-config' for the required cflags and ldflags.
+# If pkg-config is unavailable or does not find the library, try setting
+# INCLUDE_DIR and LIB_DIR manually via e.g:
+# R CMD INSTALL --configure-vars='INCLUDE_DIR=/.../include LIB_DIR=/.../lib'
+
+# Library settings
+PKG_CONFIG_NAME="arrow"
+PKG_DEB_NAME="arrow"
+PKG_RPM_NAME="arrow"
+PKG_CSW_NAME="arrow"
+PKG_BREW_NAME="apache-arrow"
+PKG_TEST_HEADER="<arrow/api.h>"
+PKG_LIBS="-larrow"
+
+# Use pkg-config if available
+pkg-config --version >/dev/null 2>&1
+if [ $? -eq 0 ]; then
+  PKGCONFIG_CFLAGS=`pkg-config --cflags --silence-errors ${PKG_CONFIG_NAME}`
+  PKGCONFIG_LIBS=`pkg-config --libs ${PKG_CONFIG_NAME}`
+fi
+
+# Note that cflags may be empty in case of success
+if [ "$INCLUDE_DIR" ] || [ "$LIB_DIR" ]; then
+  echo "Found INCLUDE_DIR and/or LIB_DIR!"
+  PKG_CFLAGS="-I$INCLUDE_DIR $PKG_CFLAGS"
+  PKG_LIBS="-L$LIB_DIR $PKG_LIBS"
+elif [ "$PKGCONFIG_CFLAGS" ] || [ "$PKGCONFIG_LIBS" ]; then
+  echo "Found pkg-config cflags and libs!"
+  PKG_CFLAGS=${PKGCONFIG_CFLAGS}
+  PKG_LIBS=${PKGCONFIG_LIBS}
+elif [[ "$OSTYPE" == "darwin"* ]]; then
+  if [ "$(command -v brew)" ]; then
+    BREWDIR=$(brew --prefix)
+  else
+    curl -sfL "https://jeroen.github.io/autobrew/default" > autobrew
+    source autobrew
+  fi
+  PKG_CFLAGS="-I$BREWDIR/opt/$PKG_BREW_NAME/include"
+  PKG_LIBS="-L$BREWDIR/opt/$PKG_BREW_NAME/lib $PKG_LIBS"
+fi
+
+# For debugging
+echo "PKG_CFLAGS=$PKG_CFLAGS"
+echo "PKG_LIBS=$PKG_LIBS"
+
+# Find compiler
+CXXCPP=$("${R_HOME}"/bin/R CMD config CXXCPP)
+CXX11FLAGS=$("${R_HOME}"/bin/R CMD config CXX11FLAGS)
+CXX11STD=$("${R_HOME}"/bin/R CMD config CXX11STD)
+CPPFLAGS=$("${R_HOME}"/bin/R CMD config CPPFLAGS)
+
+# Test configuration
+echo "#include $PKG_TEST_HEADER" | ${CXXCPP} ${CPPFLAGS} ${PKG_CFLAGS} ${CXX11FLAGS} ${CXX11STD} -xc++ - >/dev/null 2>&1
+
+# Customize the error
+if [ $? -ne 0 ]; then
+  echo "------------------------- ANTICONF ERROR ---------------------------"
+  echo "Configuration failed because $PKG_CONFIG_NAME was not found. Try installing:"
+  echo " * deb: $PKG_DEB_NAME (Debian, Ubuntu, etc)"
+  echo " * rpm: $PKG_RPM_NAME (Fedora, CentOS, RHEL)"
+  echo " * csw: $PKG_CSW_NAME (Solaris)"
+  echo " * brew: $PKG_BREW_NAME (Mac OSX)"
+  echo "If $PKG_CONFIG_NAME is already installed, check that 'pkg-config' is in your"
+  echo "PATH and PKG_CONFIG_PATH contains a $PKG_CONFIG_NAME.pc file. If pkg-config"
+  echo "is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:"
+  echo "R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'"
+  echo "--------------------------------------------------------------------"
+  exit 1;
+fi
+
+# Write to Makevars
+sed -e "s|@cflags@|$PKG_CFLAGS|" -e "s|@libs@|$PKG_LIBS|" src/Makevars.in > src/Makevars
+
+# Success
+exit 0
diff --git a/r/src/.gitignore b/r/src/.gitignore
new file mode 100644
index 0000000..22034c4
--- /dev/null
+++ b/r/src/.gitignore
@@ -0,0 +1,3 @@
+*.o
+*.so
+*.dll
diff --git a/.gitignore b/r/src/Makevars.in
similarity index 78%
copy from .gitignore
copy to r/src/Makevars.in
index ab51a6f..7a6b1fd 100644
--- a/.gitignore
+++ b/r/src/Makevars.in
@@ -15,26 +15,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-# Compiled source
-*.a
-*.dll
-*.o
-*.py[ocd]
-*.so
-*.so.*
-*.dylib
-.build_cache_dir
-MANIFEST
-
-# Generated Visual Studio files
-*.vcxproj
-*.vcxproj.*
-*.sln
-*.iml
-
-cpp/.idea/
-python/.eggs/
-.vscode
-.idea/
-.pytest_cache/
-pkgs
+PKG_CPPFLAGS=@cflags@
+PKG_CXXFLAGS=$(C_VISIBILITY)
+CXX_STD=CXX11
+PKG_LIBS=@libs@
diff --git a/r/src/RcppExports.cpp b/r/src/RcppExports.cpp
new file mode 100644
index 0000000..d819d65
--- /dev/null
+++ b/r/src/RcppExports.cpp
@@ -0,0 +1,27 @@
+// Generated by using Rcpp::compileAttributes() -> do not edit by hand
+// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
+
+#include <Rcpp.h>
+
+using namespace Rcpp;
+
+// ping_arrow
+std::string ping_arrow();
+RcppExport SEXP _arrow_ping_arrow() {
+BEGIN_RCPP
+    Rcpp::RObject rcpp_result_gen;
+    Rcpp::RNGScope rcpp_rngScope_gen;
+    rcpp_result_gen = Rcpp::wrap(ping_arrow());
+    return rcpp_result_gen;
+END_RCPP
+}
+
+static const R_CallMethodDef CallEntries[] = {
+    {"_arrow_ping_arrow", (DL_FUNC) &_arrow_ping_arrow, 0},
+    {NULL, NULL, 0}
+};
+
+RcppExport void R_init_arrow(DllInfo *dll) {
+    R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);
+    R_useDynamicSymbols(dll, FALSE);
+}
diff --git a/r/src/hello.cpp b/r/src/hello.cpp
new file mode 100644
index 0000000..ddb512e
--- /dev/null
+++ b/r/src/hello.cpp
@@ -0,0 +1,26 @@
+// 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 "r_arrow_types.h"
+
+using namespace Rcpp ;
+using namespace arrow ;
+
+// [[Rcpp::export]]
+std::string ping_arrow(){
+  return arrow::int32()->name();
+}
diff --git a/r/src/r_arrow_types.h b/r/src/r_arrow_types.h
new file mode 100644
index 0000000..6fa6e23
--- /dev/null
+++ b/r/src/r_arrow_types.h
@@ -0,0 +1,22 @@
+// 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
+
+#define STRICT_R_HEADERS
+#include <Rcpp.h>
+#include <arrow/api.h>
diff --git a/.gitignore b/r/tests/testthat.R
similarity index 78%
copy from .gitignore
copy to r/tests/testthat.R
index ab51a6f..cda8cf9 100644
--- a/.gitignore
+++ b/r/tests/testthat.R
@@ -15,26 +15,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-# Compiled source
-*.a
-*.dll
-*.o
-*.py[ocd]
-*.so
-*.so.*
-*.dylib
-.build_cache_dir
-MANIFEST
+library(testthat)
+library(arrow)
 
-# Generated Visual Studio files
-*.vcxproj
-*.vcxproj.*
-*.sln
-*.iml
-
-cpp/.idea/
-python/.eggs/
-.vscode
-.idea/
-.pytest_cache/
-pkgs
+test_check("arrow")
diff --git a/.gitignore b/r/tests/testthat/test-arrow.R
similarity index 78%
copy from .gitignore
copy to r/tests/testthat/test-arrow.R
index ab51a6f..f76d7ee 100644
--- a/.gitignore
+++ b/r/tests/testthat/test-arrow.R
@@ -15,26 +15,8 @@
 # specific language governing permissions and limitations
 # under the License.
 
-# Compiled source
-*.a
-*.dll
-*.o
-*.py[ocd]
-*.so
-*.so.*
-*.dylib
-.build_cache_dir
-MANIFEST
+context("test-arrow.R")
 
-# Generated Visual Studio files
-*.vcxproj
-*.vcxproj.*
-*.sln
-*.iml
-
-cpp/.idea/
-python/.eggs/
-.vscode
-.idea/
-.pytest_cache/
-pkgs
+test_that("can use arrow C++ library", {
+  expect_equal(arrow:::ping_arrow(), "int32")
+})