Handling raster data with sdmTMB #258
-
Question by email:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
sdmTMB takes a data frame for model fitting where predictors are in columns and matched to an observation within the same row, similar to |
Beta Was this translation helpful? Give feedback.
sdmTMB takes a data frame for model fitting where predictors are in columns and matched to an observation within the same row, similar to
lm()
orglm()
etc. There’s no infrastructure on the backend to relate the raster data to your observations. sdmTMB can certainly be used with that type of data, but you’ll need to interpolate your raster data to your observation locations first and you’ll need to do the same thing for any new data frame you want to use in the predict function. Then you’d pass these data frames tosdmTMB()
andpredict()
. There are functions in the raster package to do that. Take a look atraster::resample()
for bilinear interpolation andraster::rasterize()
if you need t…