addToList {MetNet} | R Documentation

## Add adjacency matrix to list

### Description

This helper function used in the function `createStatisticalAdjacencyList` adds a adjacency matrix to a list of adjacency matrices.

### Usage

    addToList(l, name, object)

### Arguments

`l` | list of adjacency matrices
`name` | character, name of newly created entry
`object` | matrix containing the adjacency matrix to be added

### Details

Used internally in `createStatisticalAdjacencyList`

### Value

list containing the existing adjacency matrices and the added adjacency matrix

### Author(s)

Thomas Naake, thomasnaake@googlemail.com

### Examples

    data("x_test", package="MetNet")
    x <- x_test[, 3:dim(x_test)[2]]
    x <- as.matrix(x)
    cor_pearson <- correlation(x, type="pearson")
    cor_spearman <- correlation(x, type="spearman")
    l <- list(pearson=cor_pearson)
    MetNet:::addToList(l, "spearman", cor_spearman)

[Package MetNet version 1.2.0 Index]