Skip to content

Fix #180: Add error when occs/bg predictor values are all NA - #181

Open
fdecunta wants to merge 1 commit into
jamiemkass:masterfrom
fdecunta:master
Open

Fix #180: Add error when occs/bg predictor values are all NA #181
fdecunta wants to merge 1 commit into
jamiemkass:masterfrom
fdecunta:master

Conversation

@fdecunta

Copy link
Copy Markdown

The error is explained in the issue: #180

It is an edge case in which all the coordinates from occs or bg fall outside the extent of envs. Extracting values with terra::extract return all NAs, but the crash is produced downstream with an unrelated error message.

This patch adds a check after extracting the values and raising an error that tries to guide the user into the possible cause.

It passes all tests, and I manually tested that it fixes the problem.

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

Successfully merging this pull request may close these issues.

1 participant