network_matrix: Calculate Network Statistics Matrix

View source: R/network_matrix.R

network_matrixR Documentation

Calculate Network Statistics Matrix

Description

This function is aimed at calculating network statistics of the neighborhood
network of each cell. The output is a network statistics matrix.

Usage

network_matrix(
  coordinate,
  index,
  radius = NULL,
  NN = NULL,
  edge,
  fun = centralities,
  length_output = 30,
  name_output = NULL
)

Arguments

coordinate

a data frame containing cell indices and x and y coordinates which are labeled as index, x_center and y_center, respectively.

radius

the maximal radius length of a neighborhood. The cells whose distance to the center cell is larger than this length are not
included in the neighborhood.

NN

the number of nearest neighbors. If not NULL, only the nearest NN cells will be included in neighborhood.

edge

the maximal length of the network edge.

fun

the function which calculates the statistics of a network.
Two arguments are supposed to be in this function. The first one is a network object
and the second one is an index indicating the statistics of which vertex (cell) should be calculated.
The default function is centralities.

length_output

the number of statistics calculated in the argument fun.
The default value is 30, which is the number of statistics in the centralities function of this package.

name_output

the names of statistics calculated in the argument fun.

Value

a network statistics matrix, each rows of it representing network statistics of the neighborhood network of a single cell.


XTH1114/NBFvis documentation built on Sept. 14, 2022, 1:13 p.m.