If the length of the capture histories is 1651 the length of the intervals should be 1 less at 1650 because it is the intervals between occasions. If you look through the robust example you will see that the length of the capture history is 15 and the length of the time.intervals is 14.
Here is the code that is giving the error in process.data. Probably not the best error message because it isn't strictly an incorrect number of time intervals but the number or structure of the time.intervals.From the time.intervals the code works out the number of secondary occasions and the sum of the secondary occasions should match the length of the capture history.
- Code: Select all
if (any(nchar(data$ch)/model.list$divisor != sum(nocc.secondary)))
stop("Incorrect number of time intervals. One or more capture history lengths do not match time interval structure.")
In your email showing the intervals I also saw several exclamation points but since you didn't wrap in code argument in posting I'm not sure if they are there or not. Please check your intervals more closely. Better yet modify the following code to set secondary periods that you are using and this will generate your time.intervals for you. This is setup using secondary occasions for robust example. Just change to specify your vector of secondary occasions. Anytime you have something this large you should be using code to avoid errors.
- Code: Select all
secondary=c(2,2,4,5,2)
time.intervals=c()
for(int in 1:length(secondary))
{
if(int==length(secondary))
time.intervals=c(time.intervals,c(rep(0,secondary[int]-1)))
else
time.intervals=c(time.intervals,c(rep(0,secondary[int]-1),1))
}
time.intervals