convert_pair_matrix_str: Convert paired cluster comparison values to a matrix

View source: R/util.R

convert_pair_matrix_strR Documentation

Convert paired cluster comparison values to a matrix

Description

Convert paired cluster comparison values to a matrix

Usage

convert_pair_matrix_str(pair.str, l = NULL, directed = FALSE)

Arguments

l

labels for columns. Default is NULL, which will compute them from names(pair.num)

directed

If FALSE (default), the first value in each split will be used as columns, with the second as rows. If TRUE, first values will be rows, and second will be columns.

pair.num

a vector of values with names of compared elements separted by "_", e.g. "c1_c2", "c23_c59"

Value

a matrix containing values from pair.num, and named for each element separated by "_" in names(pair.num)

Examples


pair_values <- seq(1,27,3)
names(pair_values) <- paste(rep(letters[1:3], each = 3), rep(letters[1:3], 3), sep = "_")
pair_values

pair_matrix <- convert_pair_matrix(pair_values, directed = FALSE)
pair_matrix

pair_matrix <- convert_pair_matrix(pair_values, directed = TRUE)
pair_matrix


AllenInstitute/scrattch.hicat documentation built on Oct. 20, 2023, 6:55 a.m.