I am trying to modify aggregate.data.frame to create an aggregate method for 
survey design objects.  I am running into problems because survey design 
objects are lists, with the variables and other design information stored in 
separate dataframes, or objects of other classes, in this list. *Apply and split 
functions do not seem to work on the design objects. How do I approach this, 
without having to rewrite *apply and split (and what would that involve?)?  I 
thought of creating lots of subsets, using "subset", but that does not seem to be 
a good approach.

For example, the following line which does most of the work in the 
aggregate.data.frame does not work for design objects:

    y <- lapply(income, tapply, list(age,sex), svymean, brf.d.na,simplify = 
FALSE)

neither does the following:

     y <- lapply(split(income, list(age,sex)), svymean,brf.d.na)

 

	[[alternative HTML version deleted]]


