Spatial weights matrix for independent states on a date

wstates(date, w_func = w_contiguity, ccode = NULL)

Arguments

date

A Date or YYYY-MM-DD string

w_func

type of spatial weighting function

ccode

Optional vector of numeric G&W country codes to subset by

Examples

w <- wstates("2010-01-01") w
#> Spatial weights matrix [194 x 194] #> Type: Contiguity (rook)
plot(w)
# state capitals are by default used for the vertices when plotting # reset to null to default to centroids attr(w, "coords") <- NULL plot(w)
#> Warning: st_centroid does not give correct centroids for longitude/latitude data