Closed rahulkgour closed 1 year ago
Your error is from using ggplot2::geom_raster()
with values that are not on a regular grid. Here, you could use geom_point()
or I suppose geom_tile()
(with appropriate width and height) if that makes sense.
You're currently predicting at the data locations. If you want to predict on a grid, you will need a data frame that has the various covariate columns at relevant values. If you want to isolate the effect of a variable, you could hold all the other covariate values at constants such as their means (but be wary of spatial covariates that covary in reality). If your data is in raster format, you'll need to convert to data frame first.
Are your data presence and absence or presence only? If presence only, you may want to look into a pseudo-absence strategy. E.g., https://pbs-assess.github.io/sdmTMB-teaching/dfo-tesa-2023/
Thank you Sean. My data is presence only. Thanks for sharing the tutorial.
Hi,
I am facing error while prediction, below are the code snippet and error.
I have multiple covariates, with presence data for my species at 101 locations, located in an area of around 18000 sq km.
I was trying to give a mock run with a linear combination of all the covariates, using sdmTMB().
Is there any other way to do prediction? like using a raster stack of all the covariates instead of creating a new data with all the covariates present into it.
thanks and regards, Rahul