neighborhood: Extracts neighborhood around i,j cells of given matrix.

Description Usage Arguments

Description

Given matrix mtx.dense and positive integer k it extracts cross pattern cells:

or donut shape. The above cells are columns in resulting data frame, so it has in total 2 + 4 * k + 1 columns: first two are cell coordinates in initial matrix, i.e.: i and j, remaining columns are the above values (in the order specified above). Selection of cross size k enforces that cells belonging to rows, columns or diagonals (starting at main diagonal) with indices 1 to k or n-k+1 to n can't be assigned any value.

Usage

1
2
3
4
5
6
7
8
neighborhood(
  mtx.dense,
  k = 1,
  max.d = 0.15,
  m = 1,
  which.ngb = c("cross", "donut")[1],
  include.ij = FALSE
)

Arguments

mtx.dense

numeric symmetric matrix

k

numeric radius size

max.d

numeric fraction of domains to be taken, i.e.: if mtx.dense is of size n (i.e. it have n diagonals) then floor(max.d * n) diagonals, starting at main diagonal will be taken and remaining will be discarded.

m

numeric how many diagonals (starting at main diagonal) to discard, by definition of cross this must be fixed to m > k to have effect as m will be finally be selected as: max(k,m)

which.ngb

character indicating the shape of neighborhood to extract, either "cross" or "donut"

include.ij

logical whether to include the value of cell for which neighborhood is extracted


rz6/CopulaHiC documentation built on Dec. 31, 2019, 9:19 a.m.