Learn R Programming

RScelestial (version 1.0.4)

as.ten.state.matrix: Conversion of 0/1 matrix to 10-state matrix

Description

It converts 0 to A/A and 1 to C/C. 3 that represents missing values are converted to "./.".

Usage

as.ten.state.matrix(mut)

Value

A data frame with the exact size as mut, in which 0, 1 and 3 (or NAs) are replaced with "A/A", "C/C", and "./.", respectively.

Arguments

mut

A dataframe representing the mutation matrix.

Examples

Run this code
## A small 0/1/NA mutation matrix
mut = data.frame("C1" = c(0, 0), "C2" = c(0, 3), "C3" = c(1, 0))
## Convert it to 10-state matrix
as.ten.state.matrix(mut)
#    C1  C2  C3
# 1 A/A A/A C/C
# 2 A/A ./. A/A

Run the code above in your browser using DataLab