Skip to content

Commit

Permalink
initial R 📦 with travis setup and testthat suite, that links to arrow…
Browse files Browse the repository at this point in the history
… c++ library and calls arrow::int32()
  • Loading branch information
romainfrancois committed Sep 24, 2018
1 parent 26e712d commit b829bdf
Show file tree
Hide file tree
Showing 9 changed files with 92 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dev/release/rat_exclude_files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ c_glib/doc/reference/gtk-doc.make
*.scss
r/R/RcppExports.R
r/src/RcppExports.cpp
<<<<<<< HEAD
r/DESCRIPTION
r/LICENSE.md
r/NAMESPACE
Expand All @@ -128,3 +129,5 @@ r/arrow.Rproj
r/README.md
r/README.Rmd
r/man/*.Rd
=======
>>>>>>> initial R :package: with travis setup and testthat suite, that links to arrow c++ library and calls arrow::int32()
3 changes: 3 additions & 0 deletions r/.Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
^.*\.Rproj$
^\.Rproj\.user$
<<<<<<< HEAD
^README\.Rmd$
src/.clang-format
LICENSE.md
^README\.Rmd$
=======
>>>>>>> initial R :package: with travis setup and testthat suite, that links to arrow c++ library and calls arrow::int32()
20 changes: 20 additions & 0 deletions r/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
Package: arrow
<<<<<<< HEAD
Title: R Integration to 'Apache' 'Arrow'
Version: 0.0.0.9000
Authors@R: c(
person("Romain", "François", email = "[email protected]", role = c("aut", "cre")),
person("Apache Arrow", email = "[email protected]", role = c("aut", "cph"))
)
Description: R Integration to 'Apache' 'Arrow'.
=======
Title: Bindings to 'Apache' 'Arrow'
Version: 0.0.0.9000
Authors@R: c(
person("Romain", "François", email = "[email protected]", role = c("aut", "cre"))
)
Description: R bindings to Apache Arrow.
>>>>>>> initial R :package: with travis setup and testthat suite, that links to arrow c++ library and calls arrow::int32()
Depends: R (>= 3.5)
License: Apache License (>= 2.0)
Encoding: UTF-8
LazyData: true
SystemRequirements: C++11
<<<<<<< HEAD
LinkingTo:
Rcpp (>= 0.12.18)
Imports:
Expand All @@ -32,3 +42,13 @@ Collate:
'memory_pool.R'
'status.R'
'zzz.R'
=======
LinkingTo:
Rcpp
Imports:
Rcpp
Roxygen: list(markdown = TRUE)
RoxygenNote: 6.0.1.9000
Suggests:
testthat
>>>>>>> initial R :package: with travis setup and testthat suite, that links to arrow c++ library and calls arrow::int32()
4 changes: 4 additions & 0 deletions r/NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Generated by roxygen2: do not edit by hand

<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
=======
Expand Down Expand Up @@ -68,4 +69,7 @@ importFrom(Rcpp,sourceCpp)
>>>>>>> initial R :package: with travis setup and testthat suite, that links to arrow c++ library and calls arrow::int32()
=======
>>>>>>> Initial work for type metadata, with tests.
=======
importFrom(Rcpp,sourceCpp)
>>>>>>> initial R :package: with travis setup and testthat suite, that links to arrow c++ library and calls arrow::int32()
useDynLib(arrow, .registration = TRUE)
7 changes: 7 additions & 0 deletions r/R/RcppExports.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

<<<<<<< HEAD
ArrayData_initialize <- function(type, length, null_count, offset) {
.Call(`_arrow_ArrayData_initialize`, type, length, null_count, offset)
<<<<<<< HEAD
Expand Down Expand Up @@ -536,3 +537,9 @@ Status_code <- function(status) {
Status_message <- function(status) {
.Call(`_arrow_Status_message`, status)
}
=======
ping_arrow <- function() {
.Call(`_arrow_ping_arrow`)
}

>>>>>>> initial R :package: with travis setup and testthat suite, that links to arrow c++ library and calls arrow::int32()
3 changes: 3 additions & 0 deletions r/R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@

#' @useDynLib arrow, .registration = TRUE
#' @importFrom Rcpp sourceCpp
<<<<<<< HEAD
#' @exportPattern "^.*$"
=======
>>>>>>> initial R :package: with travis setup and testthat suite, that links to arrow c++ library and calls arrow::int32()
NULL
3 changes: 3 additions & 0 deletions r/configure
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@

# Anticonf (tm) script by Jeroen Ooms, Jim Hester (2017)
<<<<<<< HEAD
<<<<<<< HEAD
# License: MIT
#
=======
>>>>>>> initial R :package: with travis setup and testthat suite, that links to arrow c++ library and calls arrow::int32()
=======
>>>>>>> initial R :package: with travis setup and testthat suite, that links to arrow c++ library and calls arrow::int32()
# 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:
Expand Down
27 changes: 27 additions & 0 deletions r/src/hello.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// 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 <Rcpp.h>
#include "rrrow_types.h"

using namespace Rcpp ;
using namespace arrow ;

// [[Rcpp::export]]
std::string ping_arrow(){
return arrow::int32()->name();
}
22 changes: 22 additions & 0 deletions r/tests/testthat/test-arrow.R
Original file line number Diff line number Diff line change
@@ -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.

context("test-arrow.R")

test_that("can use arrow C++ library", {
expect_equal(arrow:::ping_arrow(), "int32")
})

0 comments on commit b829bdf

Please sign in to comment.