R syntax can be a bit confusing. The data.table component attempts to create a higher level abstraction of tables and processing them. This component it quite powerful. In some cases the name of a variable to use is a character string, sometimes not. It's common to pass an empty argument, among other things. This is not unusual for R, but takes a bit of noodling to overcome.

Data Camp does a good job of teaching how to use R for data science. I've found the data.table Cheat Sheet extemely useful for instant. Here's a handy link: