Learn R Programming

coRNAi (version 1.22.0)

tt2matrix: Extracting data from a toptable and format it to matrix

Description

Given an dataframe with data, typically from the interactiontable, the gene pair data is converted to a symmetric matrix.

Usage

tt2matrix(toptable, what)

Arguments

toptable
a dataframe with data for the pairwise interactions. Typically from the interactiontable function.
what
character indicating which of the columns in the dataframe should be used in the matrix.

Value

a symmetric matrix with the selected data for gene pair i,j in matrix[i,j] and matrix[j,i]

Examples

Run this code
## simulated data
mytoptable = data.frame("ID" = c("A B", "A C", "B C"),"size"=c(1:3),stringsAsFactors=FALSE)
rownames(mytoptable) = mytoptable$ID
mat = tt2matrix(mytoptable,what="size")

Run the code above in your browser using DataLab