Re: [R] 3D matrix columns messed up _ looking for your help

2015-10-14 Thread Jim Lemon
actor")), .Names = c("Tag", "site", > "DATE", "date"), row.names = c(NA, -3L), class = "data.frame") > > A$date<-factor(A$DATE, levels=c("t1","t2","t3")) > tmp <- split(A, A$Tag) > head(tmp) &

Re: [R] 3D matrix columns messed up _ looking for your help

2015-10-13 Thread Jim Lemon
Hi Kristi, This is a bit hard to follow, but I'll try. As you are replacing the numeric values of the intermediate table with the character values of the factor A$date, it looks to me as though the answer is as it should be. 2 -> ENL, 3 -> ENM. I suspect that the solution is not difficult, but I

Re: [R] 3D matrix columns messed up _ looking for your help

2015-10-13 Thread Kristi Glover
te"), row.names = c(NA, -3L), class = "data.frame") A$date<-factor(A$DATE, levels=c("t1","t2","t3")) tmp <- split(A, A$Tag) head(tmp) tail(tmp) tmp1 <- do.call(rbind, lapply(tmp, function(x){ tb <- table(A$date) idx <- which(tb>0) t