Skip to main content

A Gentle Introduction to Rcpp

  • Chapter
  • First Online:
Seamless R and C++ Integration with Rcpp

Part of the book series: Use R! ((USE R,volume 64))

Abstract

This initial chapter provides a first introduction to Rcpp. It uses a somewhat slower pace and generally more gentle approach than the rest of the book in order to show key concepts which are revisited and discussed in more depth throughout the remainder. So the aim of this chapter is to cover a fairly wide range of material, but at a more introductory level for an initial overview. Two larger examples are studied in detail. We first compute the Fibonacci sequence in three different ways in two languages. Second, we simulate from a multivariate dynamic model provided by a vector autoregression.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 69.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 89.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    See http://stackoverflow.com/questions/6807068/.

  2. 2.

    See http://en.wikipedia.org/wiki/Fibonacci_number.

  3. 3.

    http://en.wikibooks.org/wiki/Fibonacci_number_program.

References

  • Chambers JM (1998) Programming with Data: A Guide to the S Language. Springer, Heidelberg, ISBN 978-0387985039

    Google Scholar 

  • Kusnierczyk W (2012) rbenchmark: Benchmarking routine for R. URL http://CRAN.R-Project.org/package=rbenchmark, R package version 1.0

  • Meyers S (2005) Effective C++: 55 Specific Ways to Improve Your Programs and Designs, 3rd edn. Addison-Wesley Professional, ISBN 978-0321334879

    Google Scholar 

  • Sanderson C (2010) Armadillo: An open source C++ algebra library for fast prototyping and computationally intensive experiments. Tech. rep., NICTA, URL http://arma.sf.net

  • Sklyar O, Murdoch D, Smith M, Eddelbuettel D, François R (2012) inline: Inline C, C++, Fortran function calls from R. URL http://CRAN.R-Project.org/package=inline, R package version 0.3.10

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2013 The Author

About this chapter

Cite this chapter

Eddelbuettel, D. (2013). A Gentle Introduction to Rcpp. In: Seamless R and C++ Integration with Rcpp. Use R!, vol 64. Springer, New York, NY. https://doi.org/10.1007/978-1-4614-6868-4_1

Download citation

Publish with us

Policies and ethics