Skip to Content
R Programming By Example
book

R Programming By Example

by Omar Trejo Navarro
December 2017
Beginner to intermediate
470 pages
12h 29m
English
Packt Publishing
Content preview from R Programming By Example

Measuring by profiling and benchmarking

There's a common saying which states that you can't change what you can't measure. Even though you can technically change your code's performance in R, you definitely won't be able to know whether a change is worth it if you don't measure it. In this section, we will introduce three tools you can use to measure your code: Rprof(), system.time(), and microbenchmark(). The first two are included in R, and the third one requires the microbenchmark package to be installed. The Rprof() tool is used to profile code, while system.time() and microbenchmark() are used to benchmark code.

  • Profiling means that you measure how much time a particular implementation is spending on each of its parts.
  • Benchmarking ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Efficient R Programming

Efficient R Programming

Colin Gillespie, Robin Lovelace
R Programming

R Programming

Jared P. Lander

Publisher Resources

ISBN: 9781788292542Supplemental Content