as.qmatrix: Converts into Q matrix

View source: R/utils.R

as.qmatrixR Documentation

Converts into Q matrix

Description

This function tests Q matrix objects, and converts matrix objects into valid Q matrices.

Usage

as.qmatrix(Q)

Arguments

Q

an object of class matrix containing a matrix of ancestry coefficients.

Value

An object of class tess3Q.

Author(s)

Kevin Caye, Olivier François

See Also

plot.tess3Q barplot.tess3Q

Examples

library(tess3r)
## an example with 3 individuals and 2 clusters
Qmatrix <- matrix(c(0.4,0.6,0.3,0.7, 0.2, 0.8), byrow = TRUE, nrow = 3)
Qmatrix <- as.qmatrix(Qmatrix)
barplot(Qmatrix, space = 0, xlab = "individuals",
        ylab = "Ancestry proportions", main = "Ancestry matrix")

bcm-uga/TESS3_encho_sen documentation built on June 30, 2023, 3:08 a.m.