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

nlm_neigh #22

Closed
marcosci opened this issue Mar 1, 2018 · 0 comments
Closed

nlm_neigh #22

marcosci opened this issue Mar 1, 2018 · 0 comments
Assignees

Comments

@marcosci
Copy link
Collaborator

marcosci commented Mar 1, 2018

ropensci/software-review#188 (comment):

Additional checks: set lower and upper values in the assert_numeric statement for p_neigh and p_empty; check neighborhood contains the accepted values; check proportions sums to 1.

Note on the last one - it's important because if proportions do not sum to 1, then the remaining cells are assigned to class 0, meaning that proportions = c(0.1, 0.1, 0.1) would result in a landscape with 80% class 0 and 10% the other two.

Because the categories are integers, it doesn't make sense to rescale the raster for this function. I would suggest defaulting to FALSE or getting rid of the option altogether.

rev(proportions) on line 91 means that the proportions are assigned to the categories backwards. e.g. nlm_neigh(ncol = 50, nrow = 50, p_neigh = 0.5, p_empty = 0.5, categories = 2, proportions = c(0.75, 0.25)) will result in a landscape where 25% is assigned to 0 and 75% to 1. This could be confusing when the proportions are closer.

@marcosci marcosci assigned z3tt and marcosci and unassigned z3tt Mar 1, 2018
marcosci added a commit that referenced this issue Mar 5, 2018
unified neighbourhood spelling everwhere and argument neighbourhood in nlm_neigh now takes integers instead of characters

resolves #22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants