This function tests Q matrix objects, and converts matrix
objects into valid Q matrices.
as.qmatrix(Q)
Q | an object of class |
---|
An object of class tess3Q
.
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")#> Use CreatePalette() to define color palettes.#> $order #> [1] 1 2 3 #>