Hello,
I'm having a problem merging occasion specific data with my design data.
I'm working with the robust design and my data consist of six primary sessions of 8,7,6,8,7 and 7 days in length. I want to assign temperature (min, max and avg) as time specific covariates to "p" and "c" for each sampling occasion. In the design data list the values under the "time" field for p are not unique numbers, but start again from 1 for each primary session: i.e. 1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,1... and so on for the 43 occasions. This is my code so far:
dat<-import.chdata(filename="pinks_all_covar2.txt",header=T)
int<-read.table(file="int.txt,header=F)
process1<-process.data(dat,model="Robust",begin.time=1,time.intervals=int)
mdd1<-make.design.data(process1)
temp<-read.table(file="temp.txt",header=T)
ptime<-mdd1$p$time
avgtemp<-data.frame(time=ptime,avgtemp=temp[,1])
So I've taken the times directly from mdd1$p$time so that the time field in the new data frame matches the time field in the design data list. However when I attempt the merge with the following code, I get an error message:
mdd1$p<-merge.design.covariates(mdd1$p,avgtemp,bygroup=FALSE,bytime=TRUE)
Error in 'row.names<-.data.frame'('*tmp*',value=c("1","2","3","4",: invalid 'row.names' length
There was no problem with creating the avgtemp data frame, both fields had 43 values. In the dipper example there are seven unique occasions and seven values for effort assigned. In my case each sampling occasion is a unique time, but the mdd1$p$time field has repeated numbers for each session. I'm not sure if this has something to do with the error?
Any help will be much appreciated,
Annabel.