Description Usage Arguments Details Value
Takes an incidence matrix with regions in rows and units in columns, where elements are a binary incidence (RCA), and unit-unit similarity matrix. Calculates the density around each nit for each region, based on units present in the region in the incidence matrix. Outputs a region x unit matrix with density in elements.
1 | get_density(rca_mat, sim_mat, binary = TRUE)
|
rca_mat |
Binary matrix that contains regions in rows, units in columns and presence/incidence in elements. |
sim_mat |
Unit x unit matrix with similarity-values in elements |
binary |
logical. If false, a non-binary RCA matrix is allowed as input. This means that RCA is used as weights to similarity values. |
General method: density of a region around a unit U is defined as the sum of all similarity-values between the units contained in the region (the 1s in the incidence matrix) and the unit U, divided by the sum of Us similarity-values to all other individual units. By taking the dot product between the incidence matrix and the relatedness matrix, we get a matrix the shape of the incidence matrix, but for each unit (column) the value is the sum of contained prducts relatedness to that product. This matrix is divided by the columnsums of the relatedness_matrix (which is the sum of all global unit relatedness scores).
Region x unit matrix that contains density for regions around units in elements.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.