the data.table vignette defines the special symbol .BY
as
.BY is a list containing a length 1 vector for each item in by. This can be useful when by is not known in advance. The by variables are also available to j directly by name; useful for example for titles of graphs if j is a plot command, or to branch with if() depending on the value of a group variable.
This description is confusing to me. How and when would I use .BY
? Even for titles of graphs? Why was it added as a special symbol?
example("data.table")
doesn't have any examples, and I haven't found any on the data.table wiki page. I don't know how to search on stack overflow for data.table and .BY usages either. I keep getting hits that use the by
operator in data.table