Data.table

  • Introduction to data.table

    The cleaning and transformation of data belong to the most time consuming parts of any economic analysis. Many graphical or statistical functions in R require specifically formatted data to work properly. Although the standard functions of R can be used to prepare your data for further analysis, some people find them a bit laborious for daily applications. Therefore, alternatives have been developed, which make data transformation in R easier and also faster. One of these alternatives is the data.table package. It is known for its very concise syntax and for its excellent performance on large data sets, which is why it is a popular choice whenever speed and memory consumption matter.1 In the following I give an introduction to the main elements of the data.table syntax. It covers the same operations as my introduction to dplyr, so that both approaches can be compared directly.