Re: [R] matrix calculation

2011-12-10 Thread David Winsemius
On Dec 10, 2011, at 9:13 AM, R. Michael Weylandt wrote: Perhaps something like this (untested) -- it's going to depend on the exact structure of your data so if this doesn't work, please use dput() to send a plain text representation: tapply(data, data$animal, function(d) d[, c("A01", "A02")]

Re: [R] matrix calculation

2011-12-10 Thread R. Michael Weylandt
Perhaps something like this (untested) -- it's going to depend on the exact structure of your data so if this doesn't work, please use dput() to send a plain text representation: tapply(data, data$animal, function(d) d[, c("A01", "A02")] - d[d$time == "d0", c("A01", "A02")] ) In short, take "data

[R] matrix calculation

2011-12-09 Thread Junyu Lee
Hello, I have a matrix animaltime A01 A02 A d0 -5.4 2.7 A d1124.6 5.9 A d224 3.96.3 B