Learn R Programming

iCAMP (version 1.5.12)

dist.bin.3col: Convert a list of dist (or matrixes) to a matrix

Description

Convert a list of distance matrixes (or square matrixes) with the same sample IDs into a matrix.

Usage

dist.bin.3col(dist.bin, obj.name = NULL)

Arguments

dist.bin

a list, each element is a distance matrix or square matrix. all elements have exactly the same sample IDs (rownames and colnames) which are in the same order.

obj.name

a character, as a prefix of the bin names.

Value

output is a matrix. The first two columns are sample IDs, and each of the following columns represent an element in the original list which usually is a bin in iCAMP analysis.

Details

A tool to facilitate format transformation in iCAMP analysis.

Examples

Run this code
# NOT RUN {
# let's see a very simple example
bin.dist=as.matrix(dist(1:10))
rownames(bin.dist)<-colnames(bin.dist)<-paste0("Sample",1:10)
dist.bins=list(bin1=bin.dist,bin2=bin.dist+1,bin3=bin.dist*2)
dis.3c=dist.bin.3col(dist.bins,obj.name="test")
# }

Run the code above in your browser using DataLab