sf_to_spm {smile} | R Documentation |
single sf
to spm
Description
Transforming a sf
into a spm
object (Internal use)
Usage
single_sf_to_spm(
sf_obj,
n_pts,
type = "regular",
by_polygon = FALSE,
poly_ids = NULL,
var_ids = NULL,
trunc_d = NULL
)
sf_to_spm(
sf_obj,
n_pts,
type = "regular",
by_polygon = FALSE,
poly_ids = NULL,
var_ids = NULL,
trunc_d = NULL
)
Arguments
sf_obj |
a |
n_pts |
a |
type |
a |
by_polygon |
a |
poly_ids |
a |
var_ids |
a scalar or vector of type |
trunc_d |
truncation distance for grid points. Consider using half of the maximum distance between polygons |
Value
a named list
of size 6 belonging to the class
spm
. This list stores all the objects necessary to fit models
using the fit_spm
.
Examples
data(liv_lsoa) # loading the LSOA data
msoa_spm <- sf_to_spm(sf_obj = liv_msoa, n_pts = 1000,
type = "regular", by_polygon = FALSE,
poly_ids = "msoa11cd",
var_ids = "leb_est")