When Should You Use R?

I think R is a great piece of software, but it isn’t the right tool for every problem. Clearly, it would be ridiculous to write a video game in R, but it’s not even the best tool for all data problems.

R is very good at plotting graphics, analyzing data, and fitting statistical models using data that fits in the computer’s memory. It’s not as good at storing data in complicated structures, efficiently querying data, or working with data that doesn’t fit in the computer’s memory.

Typically, I use a tool like Perl to preprocess large files before using them in R. It’s technically possible to use R for these problems (by reading files one line at a time and using R’s regular expression support), but it’s pretty awkward. To hold large data files, I usually use a database like MySQL, PostgreSQL, SQLite, or Oracle (when someone else is paying the license fee).

Get R in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.