Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion on specifying truncation when data are binned #111

Open
lenthomas opened this issue Oct 6, 2021 · 0 comments
Open

Suggestion on specifying truncation when data are binned #111

lenthomas opened this issue Oct 6, 2021 · 0 comments

Comments

@lenthomas
Copy link
Member

A feature request:

In Distance for Windows, one specifies binning and can then left or right truncate at any cutpoint value. A facility like this would be convenient in Distance (and mrds) - so one would write code to investigate different truncation widths, like:

library(Distance)
data("wren_snapshot")
bin.cutpoints.100m <- bin.cutpoints <- c(0, 10, 20, 30, 40, 60, 80, 100, 120)
conversion.factor <- convert_units("meter", NULL, "hectare")
wrensnap.hn.t100 <- ds(data=wren_snapshot, key="hn", adjustment=NULL, 
                       transect="point", cutpoints=bin.cutpoints.100m,
                       convert.units=conversion.factor, truncation=100)
wrensnap.hn.t100 <- ds(data=wren_snapshot, key="hn", adjustment=NULL, 
                       transect="point", cutpoints=bin.cutpoints.100m,
                       convert.units=conversion.factor, truncation=80)
wrensnap.hn.t100 <- ds(data=wren_snapshot, key="hn", adjustment=NULL, 
                       transect="point", cutpoints=bin.cutpoints.100m,
                       convert.units=conversion.factor, truncation=60)

At present, this throws the error

Error in process.data(data, meta.data, check = FALSE) : 
  width must exceed largest interval end point


All models failed to fit!

Error in ds(data = wren_snapshot, key = "hn", adjustment = NULL, transect = "point",  : 
  No models could be fitted.

A similar facility would also be useful for left truncation.

@dill dill self-assigned this Apr 4, 2022
@dill dill removed their assignment Nov 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants