[R] Weighted descriptives by levels of another variables

Karl Ove Hufthammer karl at huftis.org
Tue Nov 17 08:17:48 CET 2009


On Mon, 16 Nov 2009 10:43:38 -0500 Andrew Miles <rstuff.miles at gmail.com> 
wrote:
> Thanks!  Using the plyr package and the approach you outlined seems to  
> work well for relatively simple functions (like wtd.mean), but so far  
> I haven't had much success in using it with more complex descriptive  
> functions like describe {Hmisc}.

'describe' outputs a list, not just a vector. To get the actual values 
as vectors, you have to extract them, e.g.:

describe(x)$counts
describe(x)$values

-- 
Karl Ove Hufthammer




More information about the R-help mailing list