Hi, > * Steve Lianoglou <[email protected]> [2012-11-19 13:30:03 > -0800]: > > For instance, if you want the min and max of `delay` within each group > defined by `share.id`, and let's assume `infl` is a data.frame, you > can do something like so: > > R> as.data.table(infl) > R> setkey(infl, share.id) > R> result <- infl[, list(min=min(delay), max=max(delay)), by="share.id"]
perfect, thanks. alas, the resulting table does not contain the share.id column. do I need to add something like "id=unique(share.id)" to the list? also, if there is a field in the original table infl which only depends on share.id, how do I add this unique value to the summary? it appears that "count=unique(country)" in list() does what I need, but it slows down the process. -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000 http://www.childpsy.net/ http://openvotingconsortium.org http://jihadwatch.org http://thereligionofpeace.com http://palestinefacts.org http://dhimmi.com Why use Windows, when there are Doors? ______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

