data.table

[R] how to do a data.table merge operation

I've been digging through the documentation for the data.table package (a replacement for data.frame that's much more efficient for certain operations), including Josh Reich's presentation on SQL and data.table at the NYC R Meetup (pdf), but can't figure this totally trivial operation out. > x <- DT(a=1:3, b=2:4, key='a') > x a b [...

data.table and "by must evaluate to list" Error

I would like to use the data.table package in R to dynamically generate aggregations, but I am running into an error. Below, let my.dt be of type data.table. sex <- c("M","F","M","F") age <- c(19, 23, 26, 21) dependent.variable <- c(1400, 1500, 1250, 1100) my.dt <- data.table(sex, age, dependent.variable) grouping.vars <- c("sex", "age"...