Skip to content

ds produces density estimates of zero #165

@erex

Description

@erex

Question from the list about output for density and abundance being zero.

Seems this is caused by the object field being a character string rather than a number. Perhaps code could be more robust to this.

minimum reproducible example

library(Distance)
data(wren_lt)
wren_lt$object <- paste0(wren_lt$Region.Label, wren_lt$object)
tst <- ds(wren_lt)
summary(tst)
Summary for distance analysis 
Number of observations :  156 
Distance range         :  0  -  100 

Model : Half-normal key function with cosine adjustment term of order 2 

Strict monotonicity constraints were enforced.
AIC   : 1417.611 

Detection function parameters
Scale coefficient(s):  
            estimate        se
(Intercept) 4.072296 0.1247543

Adjustment term coefficient(s):  
                estimate        se
cos, order 2 -0.06852801 0.1282726

                       Estimate         SE        CV
Average p             0.7210344  0.1120697 0.1554291
N in covered region 216.3558470 34.8503833 0.1610790

Summary statistics:
    Region Area CoveredArea Effort n  k ER se.ER cv.ER
1 Montrave 33.2        1932   9.66 0 19  0     0     0

Abundance:
  Label Estimate se cv lcl ucl df
1 Total        0  0  0   0   0 18

Density:
  Label Estimate se cv lcl ucl df
1 Total        0  0  0   0   0 18

Remedy:

Check if the object field is.numeric otherwise, fail gracefully.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions