| make_areal_domain | R Documentation |
Build an areal domain object with adjacency weights and unit labels.
The returned object can be supplied to mesh in sdmTMB() in areal
SAR/CAR workflows.
make_areal_domain(
spatial_domain,
space_column = NULL,
id_column = NULL,
adjacency = c("rook", "queen")
)
spatial_domain |
A named |
space_column |
Column name in model data that identifies areal
unit membership. For |
id_column |
Optional column name in an |
adjacency |
Polygon adjacency type for |
A list with class c("sdmTMBareal", "sdmTMBdomain").
data(ohio_df)
data(ohio_sf)
domain <- make_areal_domain(ohio_sf, id_column = "county")
domain$n_s
domain$unit_names
fit <- sdmTMB(
cases ~ pct_male,
data = ohio_df,
mesh = domain,
spatial_model = "car",
family = poisson(link = "log"),
offset = log(ohio_df$pop)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.