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

msdm_posteriori #314

Closed
geamaro opened this issue Aug 19, 2022 · 0 comments
Closed

msdm_posteriori #314

geamaro opened this issue Aug 19, 2022 · 0 comments

Comments

@geamaro
Copy link

geamaro commented Aug 19, 2022

When I run the code

presence.background.points.model <- rbind(presence.points.model, background.points.model)

maxent.posteriori.model <- msdm_posteriori(
records = presence.background.points.model,
x = "x",
y = "y",
pr_ab = "pr_ab",
cont_suit = maxent.predict.BR$max$max,
method = c("obr"),
thr = "max_sens_spec",
buffer = NULL,
)

I get the message

Error in quantile.default(a, 0:1000/1000) :
missing values and NaN's not allowed if 'na.rm' is FALSE

When I change the code to use a previously calculated threshold, it works fine.

maxent.posteriori.model <- msdm_posteriori(
records = presence.background.points.model,
x = "x",
y = "y",
pr_ab = "pr_ab",
cont_suit = maxent.predict.BR$max$max,
method = c("obr"),
thr = threshold.val,
buffer = NULL,
)

As if it was necessary to remove the NAs from the SpatRaster that with continuous suitability predictions before use it.

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