Open lenthomas opened 3 years ago
I've thought previously we should just remove which=1
plotting. I've rarely seen it used in the wild.
There are a few reasons the bins look different between these two plots, one is probably down to this hist
error you mention but there's also scaling to do the scaling between the area under the detection function and the area of the histogram (see the fairly heinous internals of plot.ds
for details).
Including the warning seems fine, though I think people might read which=1
effectively as a bar chart and expect that bins with more observations to be taller (than they would be accounting for uneven bin size).
Distance 1.0.4.9002
,mrds 2.2.5.9000
,R 4.1.1
.When the data are binned, and there are unequal bin widths, plotting the histogram without detection function/pdf (
plot.ds
using optionwhich = 1
) gives count frequency on the y-axis:However, it is not clear to me that this is the correct thing to do, as when we plot with the detection function superimposed, the y-axis is scaled to account for the bin width:
In this circumstance, base
R
gives a warning message:Gives
and if you use the default
freq=FALSE
then it plots the correct density. So, perhaps we should either issue a warning if people choosewhich = 1
and the bin widths aren't all the same, or we should change and plot density on the y-axis not count?