Skip to content

Handling raster data with sdmTMB #258

Answered by seananderson
seananderson asked this question in Q&A
Discussion options

You must be logged in to vote

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() or glm() 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 to sdmTMB() and predict(). There are functions in the raster package to do that. Take a look at raster::resample() for bilinear interpolation and raster::rasterize() if you need t…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by seananderson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant