tmcd82070 / Rdistance

An R package for simple, regression-like, distance-based analyses
8 stars 3 forks source link

Calculating effective distance for point surveys #65

Closed jcarlis3 closed 6 years ago

jcarlis3 commented 6 years ago

Possible bug in calculating the effective distance (ESW for lines or EDR for points) in abundance estimation routine. See line 333 of function abundEstim.R ans$esw <- abund$pDetection * abund$w Looks correct for line surveys, but not for point surveys, right?

If I understand, this esw value is just being stored in the returned object (ans), not used in any calculations of abundance.

tmcd82070 commented 6 years ago

Fixed in commit 82b08194aff2ae7487501ec8479b9d942b23e808

We determined that esw in abund objects was not being used anywhere (90% sure) and thus the bug had no effect. But now it is fixed with the following lines.

if(dfunc$pointSurvey){ ans$esw <- sqrt(abund$w^2 * abund$pDetection) # for points } else { ans$esw <- abund$pDetection * abund$w # for lines }