I keep bumping into what I think may be a bug. I'm getting an error when trying to fit any model using the ds() function, including a simple model taken directly from the "Line transect density estimation" example. I get this error when working in RStudio, but I can run the model without errors when working with R outside of RStudio. Has anyone else had this issue? I'm running R version 4.4.1, Distance 1.0.9, and a new download of RStudio. Code and error below, any insights are greatly appreciated.
library(Distance)
data(wren_lt)
conversion.factor <- convert_units("meter", "kilometer", "hectare")
wren.hn <- ds(data=wren_lt, key="hn", adjustment=NULL,
convert_units=conversion.factor)
Fitting half-normal key function
Error in if (ddfobj$type == "logistic") { : argument is of length zero
All models failed to fit!
Error: No models could be fitted.