Skip to main content
HomeR

Course

Writing Efficient R Code

IntermediateSkill Level
4.7+
129 reviews
Updated 01/2023
Learn to write faster R code, discover benchmarking and profiling, and unlock the secrets of parallel programming.
Start Course for Free
RProgramming4 hr14 videos43 Exercises3,100 XP56,543Statement of Accomplishment

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.

Loved by learners at thousands of companies

Group

Training 2 or more people?

Try DataCamp for Business

Course Description

The beauty of R is that it is built for performing data analysis. The downside is that sometimes R can be slow, thereby obstructing our analysis. For this reason, it is essential to become familiar with the main techniques for speeding up your analysis, so you can reduce computational time and get insights as quickly as possible.

Prerequisites

Intermediate R
1

The Art of Benchmarking

In order to make your code go faster, you need to know how long it takes to run. This chapter introduces the idea of benchmarking your code.
Start Chapter
2

Fine Tuning: Efficient Base R

3

Diagnosing Problems: Code Profiling

4

Turbo Charged Code: Parallel Programming

Writing Efficient R Code
Course
Complete

Earn Statement of Accomplishment

Add this credential to your LinkedIn profile, resume, or CV
Share it on social media and in your performance review
Enroll Now

Don’t just take our word for it

*4.7
from 129 reviews
79%
19%
2%
0%
0%
  • Miranda
    4 days ago

  • Arjay
    5 days ago

  • Kelvin
    last week

  • Charlotte
    2 weeks ago

    Base R may have gotten a bit speedier since this was created, but still a great course for learning about how to increase efficiency!

  • John
    2 weeks ago

  • Timothy
    3 weeks ago

Miranda

Arjay

John

FAQs

What does benchmarking mean in the context of this course?

Benchmarking is measuring how long your R code takes to run so you can identify slow sections. The first chapter teaches you techniques to time your code accurately.

What is code profiling, and which tool does this course use for it?

Code profiling identifies bottleneck lines in your script. You will use the profvis package to visualize exactly where your code spends the most time.

Does this course teach parallel programming in R?

Yes. The final chapter shows you how to use multiple cores on your machine to run R code in parallel, significantly speeding up problems that can be split into independent tasks.

What prerequisite R skills are needed?

You should have completed Introduction to R and Intermediate R. Comfort with base R data structures, loops, and apply functions will help you get the most from this course.

Will I learn alternative coding approaches that are faster in base R?

Yes. Chapter 2 teaches you that many R problems have multiple solutions, and some can be orders of magnitude faster. You will learn which base R patterns to prefer for speed.

Join over 19 million learners and start Writing Efficient R Code today!

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.

Grow your data skills with DataCamp for Mobile

Make progress on the go with our mobile courses and daily 5-minute coding challenges.