1

I have come across this comand

unique(StudentGroups[,.(groupID, start, end, student)])

I was wondereing what is the purpose of the . ?

Nneka
  • 1,764
  • 2
  • 15
  • 39
  • 2
    It is creating a `list`. You can replace with `list(groupID, ..` – akrun Feb 20 '20 at 20:32
  • 3
    Is `StudentGroups` a `data.table`? Otherwise I don't know that `.` is defined. Assuming it is (and just adding clarity and definition to @akrun's comment): from `?data.table`: "The expression `.()` is a *shorthand* alias to `list()`; they both mean the same. (An exception is made for the use of `.()` within a call to `bquote`, where `.()` is left unchanged.)" – r2evans Feb 20 '20 at 20:38
  • 3
    Some discussion of what the `.` can mean can be found: https://stackoverflow.com/a/27560562/2372064. It entirely depends on the context. – MrFlick Feb 20 '20 at 20:50

0 Answers0