Optimizing R Code with Rcpp

Use C++ to dramatically boost the performance of your R code.
Start Course for Free
4 Hours15 Videos52 Exercises2,263 Learners
4350 XP

Create Your Free Account

By continuing you accept the Terms of Use and Privacy Policy. You also accept that you are aware that your data will be stored outside of the EU and that you are above the age of 16.

Loved by learners at thousands of companies

Course Description

R is a great language for data science, but sometimes the code can be slow to run. Combining the comfort of R with the speed of a compiled language is a great way to reclaim the performance your code deserves. C++ is a modern, high performance language that is simple enough to learn in the context of accelerating R code. With the help of the Rcpp package, C++ integrates very neatly with R. You will learn how to create and manipulate typical R objects (vectors and lists), and write your own C++ functions to dramatically boost the performance of your R code.

  1. 1


    Writing, benchmarking, and debugging your first C++ code.
    Play Chapter Now
  2. 2

    Functions and Control Flow

    Writing functions, controlling the flow with if and else, and learning to use the three kinds of loops in C++.
    Play Chapter Now
  3. 3

    Vector classes

    Manipulate and compute with Rcpp and native C++ vectors.
    Play Chapter Now
  4. 4

    Case Studies

    Use random numbers and write algorithms for applied time series models.
    Play Chapter Now
Sumedh PanchadharRichie Cotton
Introduction to Writing Functions in R
Team ThinkR Headshot

Team ThinkR

R Training
ThinkR provides specialized consulting, development and training in R software.
See More

What do other learners have to say?

I've used other sites—Coursera, Udacity, things like that—but DataCamp's been the one that I've stuck with.

Devon Edwards Joseph
Lloyds Banking Group

DataCamp is the top resource I recommend for learning data science.

Louis Maiden
Harvard Business School

DataCamp is by far my favorite website to learn from.

Ronald Bowers
Decision Science Analytics, USAA