get_average_sim: Find average similarity value in region

Description Usage Arguments Value

View source: R/get_average_sim.R

Description

In the rca matrix, each region (row) has a number of units (col) with the value 1. From these units, the function finds the average value of similarity to each unit.

Usage

1
get_average_sim(rca_mat, sim_mat, exclude_0s = FALSE)

Arguments

rca_mat

binary rca matrix with region rows, units in columns

sim_mat

similarity matrix with units on both dimensions.

exclude_0s

logical If TRUE, each 0 in the binary RCA matrix is converted to NAs. This means that units not present in a region does not pull the average down. That is, it is not the average value, but the average value of units presents in the region. This pulls non-diverse regions up.

Value

matrix with regions in rows, units in columns. The elements are the average similarity-value in the region to the given unit (column).


jorgenfrost/compost documentation built on Nov. 4, 2019, 3:10 p.m.