I'm receiving the following error when trying to run a model with a time varying covariate for g0.
Preparing detection design matrices
Error in `[.data.frame`(trcov, , indices) : undefined columns selected
I followed the example code in the vignette (and an earlier post that was, coincidentally, with nearly the same dataset):
> timevaryingcov(temptrap) <- list(blockt = 1:5)
> timevaryingcov(temptrap)
$blockt
[1] 1 2 3 4 5
Except in my case, I used the covariate names as listed in my 'read.traps' statement, per the vignette:
>timevaryingcov(bnp08.traps) <- list(evi_time = "evi145trap",...,"evi305trap"). Note, all covariates of interest are listed in the code, and the number of covariates does match the number of occasions (11).
>timevaryingcov(bnp08.traps)
$evi_time
[1] "evi145trap"
[[2]]
[1] "evi160trap"
...
[[11]]
[1] "evi305trap"
Just for good measure, I tried using the number of the columns (ie, list(evit_time=4:14)) which does produce an output similar to the example, but the same error is generated upon running the model. I even tried list("evi145trap":"evi305trap"), which gives an Na/NaN error.
Also, and Murray was already kind enough to give me some advice off-list for this, I'm interested in the most streamlined way to use quadratic terms, such as for g0~elevation. The notation I'm familiar with from lme4 doesn't work (ie, g0~elevation^2).
Thanks for any advice for this R idiot.