Sharon Machlis
Contributing Writer

The ultimate R data.table cheat sheet

how-to
Oct 28, 202010 mins

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.