You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Email from Charlotte Spira today, with following error message:
hn0_bushpig <- ds(bushpig, transect = "point", key = "hn", adjustment = NULL, cutpoints = c(seq(0,8,1)), formula = ~as.factor(stratum))
Error in if (!all(in.cp.ind)) { :
missing value where TRUE / FALSE is needed.
Error comes from create_bins(). Her data were binned (0.5, 1.5, 2.5, 3.5,...) with lots of NA distances from camera traps without detections, causing NAs to appear in in.cp.ind, generating the error
Temporary work-around the problem by reverting to distbegin and distend
You will see I read in your original data, then renamed the resulting data frame and made some modifications. I changed the field "stratum" to "Region.Label" because ds() is fussy about that field name. I converted the area you had provide from (what I think) was square meters, to square kilometers for more sensible output. Did I get that right?
The cause of your original error message was that your data were already binned. It seems reasonable that the "cutpoints" argument to ds() should have done what you wanted, but it did not. Another way to accomplish the same job is to add fields "distbegin" and "distend" to the data frame. By adding those two columns, I removed the cutpoints argument and the error went away. It is something we need to investigate further. But this fix with serve your purposes for the moment.
The text was updated successfully, but these errors were encountered:
Email from Charlotte Spira today, with following error message:
Error comes from
create_bins()
. Her data were binned (0.5, 1.5, 2.5, 3.5,...) with lots of NA distances from camera traps without detections, causing NAs to appear inin.cp.ind
, generating the errorTemporary work-around the problem by reverting to
distbegin
anddistend
You will see I read in your original data, then renamed the resulting data frame and made some modifications. I changed the field "stratum" to "Region.Label" because ds() is fussy about that field name. I converted the area you had provide from (what I think) was square meters, to square kilometers for more sensible output. Did I get that right?
The cause of your original error message was that your data were already binned. It seems reasonable that the "cutpoints" argument to ds() should have done what you wanted, but it did not. Another way to accomplish the same job is to add fields "distbegin" and "distend" to the data frame. By adding those two columns, I removed the cutpoints argument and the error went away. It is something we need to investigate further. But this fix with serve your purposes for the moment.
The text was updated successfully, but these errors were encountered: