DistanceDevelopment / mrds

R package for mark-recapture-distance-sampling analysis
GNU General Public License v3.0
4 stars 4 forks source link

Expected cluster size displaying as a list #54

Closed LHMarshall closed 2 years ago

LHMarshall commented 2 years ago

The expected cluster size used to display like a table (either an array. matrix or data.frame) but it is now in the form of a list. This change caused a breakage in dsims for simulations with cluster size in.

Reproducible example:

data(book.tee.data)
region <- book.tee.data$book.tee.region
egdata <- book.tee.data$book.tee.dataframe
samples <- book.tee.data$book.tee.samples
obs <- book.tee.data$book.tee.obs

# fit a half-normal detection function
result <- ddf(dsmodel=~mcds(key="hn", formula=~1), data=egdata, method="ds",
               meta.data=list(width=4))

ests <- dht(result, region, samples, obs)
ests
Screenshot 2022-07-05 at 11 40 12
dill commented 2 years ago

I can't seem to reproduce this on my machine, are you using the latest mrds? A recent change was here to ensure that the result was printed as a data.frame. But I do see that in dht the returned object was being coerced to vector?? See here which goes back to at least Jeff's initial commit. So that's weird that it's only an issue now.

Removing the as.vector from dht doesn't appear to break anything, so let's do that and hoepfully that fixes this for you.