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

PseudoAbsence generation RSEP method #4

Open
ejosymart opened this issue Jun 4, 2020 · 0 comments
Open

PseudoAbsence generation RSEP method #4

ejosymart opened this issue Jun 4, 2020 · 0 comments

Comments

@ejosymart
Copy link

Following the example in Tackling Uncertainties of Species Distribution Model Projections with
Package mopa.

library(mopa)

destfile <- tempfile()
url <- paste0("https://raw.githubusercontent.com/SantanderMetGroup/", "mopa/master/data/biostack.rda")
download.file(url, destfile)
load(destfile, verbose = TRUE)

data(Oak_phylo2)
presences <- Oak_phylo2$H11

bg <- backgroundGrid(raster = biostack$baseline$bio1)

bg.subdomain <- backgroundGrid(raster = biostack$baseline$bio1,
spatial.subset = extent(c(-10, 35, 45, 65)))

bg.species <- backgroundGrid(raster = biostack$baseline$bio1,
spatial.subset = presences)

bg.profiled <- OCSVMprofiling(xy = presences,
varstack = biostack$baseline,
background = bg$xy)

pa_RSEP <- pseudoAbsences(xy = presences,
background = bg.profiled$absence,
realizations = 10,
exclusion.buffer = 0.249,
prevalence = -0.5)

The error message was:
Error in pseudoAbsences(xy = presences, background = bg.profiled$absence, :
xy and background do not have the same length

Also this warning message appear running backgroundGrid lines:
Warning message:
In if (class(xy) == "matrix") xy <- as.data.frame(xy) :
the condition has length> 1 and only the first element will be used

PD: I am using R 4.0.0.

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

1 participant