overlap_matrix {stcos} | R Documentation |
Matrix of overlaps between two sets of areas.
Description
A convenience function to convert output from sf::st_intersection
to a sparse matrix as defined in the Matrix
package.
Usage
overlap_matrix(dom1, dom2, proportion = TRUE)
Arguments
dom1 |
An |
dom2 |
An |
proportion |
Logical; if |
Details
Returns a matrix H
whose (i,j)th entry represent the area of the overlap
between areal units dom1[i,]
and dom2[j,]
.
Value
An matrix of overlaps.
Examples
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)
[Package stcos version 0.3.1 Index]