That's a call to the replacement function "split<-"(), which is defined as:
function (x, f, value)
{
ix <- split(seq(along = x), f)
n <- length(value)
j <- 0
for (i in ix) {
j <- j%%n + 1
x[i] <- value[[j]]
}
x
}
Andy
From: ronggui
i study the code of function ave,but i can understand one
line of the syntax.
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