Hi all,
Thanks for the advice
Ákos, I will investigate. I've been using QGIS to get my layers sorted out but I'll develop an R workflow.
What I did in the end was this:
# select one layer of my environmental raster stack and set all the subzero values to NA
sample_raster <- gis[[1]] # my raster brick
values(sample_raster)[values(sample_raster) < 0] = NA
# select random points
random_points <- sampleRandom(x=sample_raster,
size=length(longlat), # this gives me the same number as my presence records
na.rm=T, #removes the 'NA' points
sp=T)
...I then call species_model <- dismo::maxent(gis, random_points, various_other_arguments_etc)
Arjun, I have to admit it wasn't exactly a tutorial - but here is the link to the R code I was adapting.
I have had to repurpose this to adapt it to a single island (New Guinea). Let me know if I can help in any way.