Does this do what you want?
> x <- data.frame(subj=sample(1:3,20,TRUE), cond=sample(1:2,20,TRUE),
> time=runif(20,1,10))
> # add mean and sd
> x$mean <- ave(x$time, x$subj, x$cond)
> x$sd <- ave(x$time, x$subj, x$cond, FUN=sd)
> x
subj cond time mean sd
1 32 3.563114 5.63
I have been trying to figure out how Hadley Wickhams
"reshape" package works and I tried it on what may be
your problem. Here is my example. Does it do
something like what you want?
===
# Test Data
zz <- "subj cond t1 t2 t3
A1 4 5 7
A
2 matches
Mail list logo