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

2015-10-14 Thread Jim Lemon
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) > tail(tmp) > tmp1 <

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) tb1

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

2015-10-13 Thread Jim Lemon
> > 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) > tb1 <- replace(tb, idx, as.c

Re: [R] 3D matrix columns messed up

2015-10-12 Thread Jim Lemon
Hi Kristi, The first part is relatively easy: # change first line to x$time<-factor(x$time,levels=c("t1","t2","t3","t4","t10","t21")) As you have specified "site" as the second element in "x", not the third, perhaps you just want: x<-structure(list(vs = structure(c(1L, 1L, 2L, 3L, 4L, 2L, 3L, 1L