Distance::ds() can't handle column with units
in cds_detection()
distance column need to be transformed to numeric to give it to ds()
cause it can't read column with unit.
> dista
Units: [km]
[1] 718.66960 533.72326 762.56131 555.96032 864.96172 160.68625 236.40029 237.02939 335.48744
[10] 663.13697 388.31450 649.29565 78.80128 515.14908 117.15040 97.80455 147.60346 10.21769
[19] 568.22107 490.93407 119.40548 443.18073 131.26828 284.84438 1065.08299 606.47043 404.13641
[28] 211.68858 58.18677 33.42828 1027.65126 86.36348 323.87075 266.05470 657.72408 158.93677
[37] 447.43871 485.33269 244.48186 194.72707 360.15559 215.04126 277.35663 496.58346 268.35059
[46] 203.00292 1523.24139 314.66887
> test_ds <- Distance::ds(dista, key = "hn")
Starting AIC adjustment term selection.
Fitting half-normal key function
All models failed to fit!
Error in Distance::ds(dista, key = "hn") : No models could be fitted.
> test_ds <- Distance::ds(as.numeric(dista), key = "hn")
Starting AIC adjustment term selection.
Fitting half-normal key function
Key only model: not constraining for monotonicity.
AIC= 667.53
Fitting half-normal key function with cosine(2) adjustments
AIC= 669.39
Half-normal key function selected.
No survey area information supplied, only estimating detection function.