Rafał Alitojć has completed

# Writing Efficient R Code

4 hours
3,100 XP

## 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.

### .css-1goj2uy{margin-right:8px;}Group.css-gnv7tt{font-size:20px;font-weight:700;white-space:nowrap;}.css-12nwtlk{box-sizing:border-box;margin:0;min-width:0;color:#05192D;font-size:16px;line-height:1.5;font-size:20px;font-weight:700;white-space:nowrap;}Training 2 or more people?

Try DataCamp for BusinessFor a bespoke solution book a demo.
1. 1

### The Art of Benchmarking

Free

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.

Play Chapter Now
Welcome!
50 xp
R version
100 xp
Benchmarking
50 xp
Comparing read times of CSV and RDS files
100 xp
Operational differences: "<-" and "="
50 xp
Elapsed time
100 xp
Relative time
50 xp
50 xp
DataCamp hardware
100 xp
Benchmark DataCamp's machine
100 xp
2. 2

### Fine Tuning: Efficient Base R

R is flexible because you can often solve a single problem in many different ways. Some ways can be several orders of magnitude faster than the others. This chapter teaches you how to write fast base R code.

3. 3

### Diagnosing Problems: Code Profiling

Profiling helps you locate the bottlenecks in your code. This chapter teaches you how to visualize the bottlenecks using the profvis package.

4. 4

### Turbo Charged Code: Parallel Programming

Some problems can be solved faster using multiple cores on your machine. This chapter shows you how to write R code that runs in parallel.

In the following tracks

Big DataR DeveloperR Programming

Collaborators

Prerequisites

Intermediate R
Colin Gillespie

Assoc Prof at Newcastle University, Consultant at Jumping Rivers

Colin is the author of Efficient R Programming, published by O'Reilly media. He is an Associate Professor of Statistics at Newcastle University, UK and regularly works with Jumping Rivers to provide data science training and consultancy. He is the only person in history to move to Newcastle for better weather.
See More