dcast.data.table
automatically renames columns when multiple aggregation functions are used. How can I use this rename when I use only one function?
DT = melt(as.data.table(ChickWeight), id=2:4)
% automatic rename
data.table::dcast(DT, Time ~ variable, fun=list(mean, sd))
% copies only the factor level
data.table::dcast(DT, Time ~ variable, fun=mean)