Dear all,
I have a formatting problem with a generalized HDS model, i.e., gdistsamp(). We have 6 surveys with 3 distance classes at a total of 225 sites.
Formatting the unmarked data frame seems to work, see part of the summary:
unmarkedFrame Object
225 sites
Maximum number of observations per site: 18
Mean number of observations per site: 17.97
Number of primary survey periods: 6
Number of secondary survey periods: 1
Sites with at least one detection: 129
Tabulation of y observations:
0 1 2 3 <NA>
3445 527 63 9 6
.......
Yearly-site-level covariates:
observer pow licz date
Min. :1.000 M :450 Min. :1 Min. :-1.00
1st Qu.:1.000 C :420 1st Qu.:2 1st Qu.:17.00
Median :2.000 W :360 Median :3 Median :31.00
Mean :1.993 K :300 Mean :3 Mean :32.19
3rd Qu.:3.000 L :268 3rd Qu.:4 3rd Qu.:48.00
Max. :3.000 (Other):448 Max. :5 Max. :65.00
NA's :4 NA's : 4 NA's :4
Then, we try to fit a simple model ....
fm1hn <- gdistsamp(lambdaformula = ~1, phiformula = ~1,
pformula = ~1, keyfun = "halfnorm", output = "density", unitsOut = "ha",
mixture = "P", K = 50, se = TRUE, data = umf, method = 'BFGS',
control = list(trace = TRUE, REPORT = 1))
... on which we get the following error:
Error in data.frame(..., check.names = FALSE) :
arguments imply differing number of rows: 2250, 1350
We do have a couple missing values both in the response and in the yearly site covariates. Would that be the source of the problem ?
Thanks and best regards --- Marc