Editing covariates for multi-session capture history

I am working on a dataset with 12 different sessions and multiple individual covariates (sex, age, disease status). The covariates don't necessarily have the same levels for all sessions (e.g. sometimes only healthy animals are captured) causing secr to return an error. I was hoping to fix this problem by assigning the correct levels to all covariates in R but for some reason I am not able to write to the covariates.
While
works fine for a single session capture history,
does not work. Any suggestions on how to solve this issue without importing each session as a single capture history and them merging them (which would require creating new input files for each session).
Thanks,
Mathias
While
- Code: Select all
covariates(capthist)[,"sex"]<-newsex
works fine for a single session capture history,
- Code: Select all
covariates(capthist)[[1]][,"sex"]<-newsex
does not work. Any suggestions on how to solve this issue without importing each session as a single capture history and them merging them (which would require creating new input files for each session).
Thanks,
Mathias