Giter Site home page Giter Site logo

cpp11's Introduction

cpp11

R-CMD-check codecov Lifecycle: stable CRAN status

cpp11 helps you to interact with R objects using C++ code. Its goals and syntax are similar to the excellent Rcpp package.

Using cpp11 in a package

To add cpp11 to an existing package, put your C++ files in the src/ directory and add the following to your DESCRIPTION file:

LinkingTo: cpp11
SystemRequirements: C++11

Then decorate C++ functions you want to expose to R with [[cpp11::register]]. Note that this is a C++11 attribute, not a comment like is used in Rcpp.

cpp11 is a header only library with no hard dependencies and does not use a shared library, so it is straightforward and reliable to use in packages without fear of compile-time and run-time mismatches.

Alternatively, you can vendor the current installed version of cpp11 headers into your package with cpp11::vendor_cpp11(). This ensures the headers will remain unchanged until you explicitly update them.

Getting started

See vignette("cpp11") to get started using cpp11 in your scripts, particularly if you are new to C++ programming.

Getting help RStudio community

RStudio community with the cpp11 tag is the best place to ask for help using cpp11 or interfacing C++ with R.

Motivations

Rcpp has been a widely successful project, however over the years a number of issues and additional C++ features have arisen. Adding these features to Rcpp would require a great deal of work, or in some cases would be impossible without severely breaking backwards compatibility.

cpp11 is a ground up rewrite of C++ bindings to R with different design trade-offs and features.

Changes that motivated cpp11 include:

See vignette("motivations") for full details on the motivations for writing cpp11.

Conversion from Rcpp

See vignette("converting") if you are already familiar with Rcpp or have an existing package that uses Rcpp and want to convert it to use cpp11.

Learning More

Internals

See vignette("internals") for details on the cpp11 implementation or if you would like to contribute to cpp11.

Code of Conduct

Please note that the cpp11 project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Thanks

cpp11 would not exist without Rcpp. Thanks to the Rcpp authors, Dirk Eddelbuettel, Romain Francois, JJ Allaire, Kevin Ushey, Qiang Kou, Nathan Russell, Douglas Bates and John Chambers for their work writing and maintaining Rcpp.

cpp11's People

Contributors

jimhester avatar romainfrancois avatar bkietz avatar sbearrows avatar alyst avatar davisvaughan avatar tcpan avatar richfitz avatar thisisnic avatar klmr avatar kevinushey avatar jeroen avatar jennybc avatar emilhvitfeldt avatar mpadge avatar eutwt avatar vspinu avatar xhochy avatar tmastny avatar thomasp85 avatar patrickvossler18 avatar pachadotdev avatar nealrichardson avatar michaelchirico avatar batpigandme avatar renkun-ken avatar jonthegeek avatar indrajeetpatil avatar yutannihilation avatar amoeba avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.