Hi Peter,
Thanks for these information.
I used a column concatenating the listBy data to do this aggregation : (I
don't know if it's the best solution, but it seems to work).

aggregateMultiBy <- function(x, by, FUN){
        tableBy = data.frame(by)
        tableBy$byKey = ""
        for(colBy in names(by))
                tableBy$byKey = paste(tableBy$byKey, 
as.character(tableBy[,colBy]),"")
        
        tableOut <- aggregate(  x = x
                                        ,       by = list(byKey = tableBy$byKey)
                                        ,       FUN = FUN)
        tableOut <- merge(      x = tableOut
                                ,       y = tableBy
                                ,       by = "byKey")

        tableOut$byKey <- NULL
        return(tableOut)
}

Thanks again,
Guillaume

--
View this message in context: 
http://r.789695.n4.nabble.com/Memory-limit-in-Aggregate-tp3711819p3715633.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@r-project.org 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.

Reply via email to