Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying R High Performance Programming
  • Table Of Contents Toc
  • Feedback & Rating feedback
R High Performance Programming

R High Performance Programming

By : Aloysius Shao Qin Lim, Tjhi W Chandra
4.4 (14)
close
close
R High Performance Programming

R High Performance Programming

4.4 (14)
By: Aloysius Shao Qin Lim, Tjhi W Chandra

Overview of this book

This book is for programmers and developers who want to improve the performance of their R programs by making them run faster with large data sets or who are trying to solve a pesky performance problem.
Table of Contents (12 chapters)
close
close
11
Index

Summary

In this chapter, we covered a variety of techniques to leverage code in compiled languages for a near-native CPU performance. While the examples focused on C and C++, similar approaches can be used with Fortran or Java.

We first saw how compiling an R code before its execution by using the compile package can provide modest performance gains, especially for code with many loops and basic operations. JIT compilation does the same automatically for executing any R code. There is a limit, however, to how much an R code can be optimized because R is a dynamic language at its core.

Looking beyond R, we used C and C++ to achieve dramatic performance improvements. We learned how to define a C function from within R, using the inline package, and how to use Rcpp to call an external C++ function from R.

In the process, we learned about how R represents different types of data in C/C++ using SEXP pointers and SEXPREC record structures, and how to manipulate R objects using these constructs....

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY