What is the difference between data frame and data table


  R Interview Questions

Data frame is one of the basic data structures in R. You can perform many manipulations on a data frame like selection, subsetting, merging, stacking, unstacking etc. However, data in a data frame is all in memory. 

So, obviously there is a limit to how much data you can manipulate in a data frame. Data tables are created with the following in mind

  • Easy and fast grouping
  • Easy SQL like syntax for filtering
  • Faster joins
  • Index based retrieval
  • Faster file reading
  • Ability to check the amount of memory used