addToList: Add adjacency matrix to list

View source: R/statistical.R

addToListR Documentation

Add adjacency matrix to list

Description

This helper function used in the function 'statistical' adds an adjacency matrix to a 'list' of adjacency matrices.

Usage

addToList(l, name, object)

Arguments

l

'list' of adjacency matrices

name

'character', name of added entry

object

'matrix' that will be added

Details

The function 'addToList' is a helper function used internally in 'statistical'.

Value

'list' containing the existing matrices and the added matrix

Author(s)

Thomas Naake, thomasnaake@googlemail.com

Examples

data("x_test", package = "MetNet")
x <- x_test[1:10, 3:ncol(x_test)]
x <- as.matrix(x)
cor_pearson <- correlation(x, method = "pearson")
cor_spearman <- correlation(x, method = "spearman")
l <- list(pearson = cor_pearson)
MetNet:::addToList(l, "spearman_coef", cor_spearman$r)

tnaake/MetNet documentation built on Feb. 21, 2023, 12:20 p.m.