da2DT | R Documentation |
lda
object to a long-format data.table
Convert a lda
object to a long-format data.table
da2DT(daObj, sampVec, obsPops)
daObj |
Lda: An object produced by |
sampVec |
Character: The sample IDs, which need to match the sample
order in |
obsPops |
Character/Factor: The observed population IDs, which need to
match sample order in |
Returns a wide-format data.table with columns $POP
, the
population IDs, $SAMPLE
, the sample IDs, $LD[x]
, the individual
LD axes, with [x]
denoting the axis number.
library(genomalicious)
data(data_Genos)
PCA <- pca_genos(data_Genos, popCol='POP')
DA <- lda(PCA$pops ~ PCA$x[,1:3])
da2DT(DA, sampVec=rownames(PCA$x), obsPops=PCA$pops)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.