overlap_matrix | R Documentation |
A convenience function to convert output from sf::st_intersection
to a sparse matrix as defined in the Matrix
package.
overlap_matrix(dom1, dom2, proportion = TRUE)
dom1 |
An |
dom2 |
An |
proportion |
Logical; if |
Returns a matrix H
whose (i,j)th entry represent the area of the overlap
between areal units dom1[i,]
and dom2[j,]
.
An matrix of overlaps.
data("acs_sf")
dom1 = acs5_2013[1:10,]
dom2 = acs5_2016[1:10,]
H1 = overlap_matrix(dom1, dom2)
H2 = overlap_matrix(dom1, dom2, proportion = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.