Sharon Machlis
Executive Editor, Data & Analytics

The ultimate R data.table cheat sheet

how-to
Oct 28, 202010 mins
AnalyticsR LanguageSoftware Development

How do I do that in data.table? Find code for dozens of data tasks in this searchable cheat sheet of R data.table and Tidyverse code.

Do More With R [video teaser/video series] - R Programming Guide - Tips & Tricks
Credit: Thinkstock

Speed. Concise syntax. Backwards compatibility.

But especially speed.

Those are some of the features that make R’s data.table compelling to its fans.

And even if you’re a confirmed tidyverse user (as I am), data.table can be a useful addition to your R toolkit — especially when working with large data sets, in a Shiny app, or in a package function. 

This R data.table ultimate cheat sheet is different from many others because it’s interactive. You can search for a specific phrase like add column or by a type of task group such as Subset or Reshape. In addition, because this cheat sheet includes tidyverse “translation” code, you can also search for a favorite dplyr verb such as mutate or rowwise.

Registered InfoWorld users can download an expanded version of this interactive table for use on their own systems! Registration is free. 

Search data.table and tidyverse tasks and code

There is a lot more to learn about data.table! For some data.table basics, check out my five-minute introductory video:

Finally, the data.table website has lots more information and tips, such as using setkey() and other indexing tips.

Sharon Machlis
Executive Editor, Data & Analytics

Sharon Machlis is Director of Editorial Data & Analytics at Foundry (the IDG, Inc. company that publishes websites including Computerworld and InfoWorld), where she analyzes data, codes in-house tools, and writes about data analysis tools and tips. She holds an Extra class amateur radio license and is somewhat obsessed with R. Her book Practical R for Mass Communication and Journalism was published by CRC Press.

More from this author