[R] what does this syntax mean?

From: ronggui <0034058_at_fudan.edu.cn>
Date: Sun 19 Jun 2005 - 16:05:49 EST


i study the code of function ave,but i can understand one line of the syntax.

> ave

function (x, ..., FUN = mean)
{

    n <- length(list(...))
    if (n) {

        g <- interaction(...)
        split(x, g) <- lapply(split(x, g), FUN)
    }
    else x[] <- FUN(x)
    x

}

my question is : what does "split(x, g) <- lapply(split(x, g), FUN)" mean?

thank you!

-- 
Department of Sociology
Fudan University,Shanghai
Blog:http://sociology.yculblog.com

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Sun Jun 19 16:06:42 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:51 EST