I'm analyzing 5 years of nest data and am having difficulty with factor variables. When I run a model based on year (each year treated as a vector of 0s and 1s similar to the example in the RMark mallard example with habitat types) I get the following error:
"Error in data.frame(..., check.names = FALSE) :
arguments imply differing number of rows: 296, 0"
from the following code (based on the mallard example):
year<-mark(lesc, nocc=64, model="Nest", model.parameters=list(S=list(formula=~y2007 + y2008 + y2009 + y2010)),
groups=c("y2007","y2008","y2009","y2010"))
Year 2006 is indicated when years 2007-10 are 0s. I've looked the error up online and it seems to be for determining if a dataframe has differing vector lengths among columns. Each of the year factor variables has the proper number (296) of rows in my dataframe. Any help would be greatly appreciated.