--
You received this message because you are subscribed to the Google Groups "Maxent" group.
To unsubscribe from this group and stop receiving emails from it, send an email to maxent+un...@googlegroups.com.
To post to this group, send email to max...@googlegroups.com.
Visit this group at http://groups.google.com/group/maxent?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
I haven't tried using bias grids with dismo, so can't answer your question, but one solution is to sample your own background, e.g. with:
bg <- xyFromCell(xbias, sample(ncell(xbias), 10000, prob=values(xbias)))
Where xbias is your bias raster object. If your enviro grids have NAs, then you probably want to prevent those cells from being sampled, e.g.
bg <- xyFromCell(xbias, sample(which(!is.na(values(xbias))), 10000, prob=values(xbias)[!is.na(values(xbias))]))
Untested and typing this on my phone with arg names from memory, so might not be quite right, but hopefully you get the gist ;)
You can then extract predictor values at the points and provide data to the maxent function as swd. Benefit of this approach is that maxent doesn't need to spend time sampling the background every time you run the model.
I created a bias file (via Target Group Sampling) that I would like to include to run a model in MaxEnt. I am able to run it without any problems when using the bias option file directly on MaxEnt. However, I have not been successful to set up a MaxEnt run from the R package dismo using the exact same biasfile. Does the bias file need to be in a different format to run it through R? Thank you.
model <- maxent(x = predictors, p = response, removeDuplicates=TRUE, args = c("-P", "-J", biasfile=biasfile"))
Error: Bias grid cannot be used with SWD-format background
class : RasterLayer
dimensions : 3014, 4033, 12155462 (nrow, ncol, ncell)
resolution : 0.005785418, 0.005785418 (x, y)
extent : -67.74363, -44.41104, 40.04867, 57.48592 (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0
data source : D:\GIS\Data\MarMammData\bias_file.tif
names : bias_file
values : 1, 1 (min, max)
> predictors
class : RasterStack
dimensions : 3014, 4033, 12155462, 2 (nrow, ncol, ncell, nlayers)
resolution : 0.005785418, 0.005785418 (x, y)
extent : -67.74363, -44.41104, 40.04867, 57.48592 (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs
names : bath, slope