Re: [R] Strange output daply with empty strata

2010-09-09 Thread Dennis Murphy
Hi: Here's what I tried: # data frame versions (aggregate, ddply): aggregate(age ~ municipality + employed, data = data.test, FUN = mean) municipality employed age 1B no 55.57407 2C no 44.67463 3A yes 41.58759 4B yes

Re: [R] Strange output daply with empty strata

2010-09-09 Thread hadley wickham
daply(data.test, .(municipality, employed), function(d){mean(d$age)} )     employed municipality   no  yes    A 41.58759 44.67463    B 55.57407 43.82545    C 43.59330   NA The .drop argument has a different meaning in daply. Some R functions have

Re: [R] Strange output daply with empty strata

2010-09-09 Thread Jan van der Laan
This is a bug, which I've fixed in the development version (hopefully to be released next week). In the plyr 1.2: OK, thank you both for your answers. I'll wait for the next version. Regards, Jan __ R-help@r-project.org mailing list