[adegenet-forum] screeplot (spca)excluding some first few egenvalues

Jombart, Thibaut t.jombart at imperial.ac.uk
Fri Dec 17 17:37:05 CET 2010


Hi Nevil,

sure, but that depends on whether you want to plot eigenvalues, or their decomposition.
For the first, try:
#####
barplot(myspca$eig[-1])
#####

For the decomposition into variance and Moran's index, you need to use summary first; example with a spca called spca1: 
#####
data(sim2pop)
spca1=spca(sim2pop, type=1, scannf=FALSE)
toto=summary(spca1)

## plot all eigenvalues
plot(toto$spca[,2:3], type="n")
text(toto$spca[,2:3], lab=1:nrow(toto$spca)) 

## plot all but the first eigenvalue
plot(toto$spca[-1,2:3], type="n")
text(toto$spca[-1,2:3], lab=2:nrow(toto$spca)) 

#####

Best

Thibaut

________________________________________
From: adegenet-forum-bounces at lists.r-forge.r-project.org [adegenet-forum-bounces at lists.r-forge.r-project.org] On Behalf Of Nevil Amos [nevil.amos at gmail.com]
Sent: 17 December 2010 13:03
To: adegenet-forum at lists.r-forge.r-project.org
Subject: [adegenet-forum] screeplot (spca)excluding some first few egenvalues

As a flow on from my last query,  we have mtDNA data with tow "deep"
distinct clades that alone explain most of the variance, however there
are further eigenvalues for structures 2,3,4 that may still stand out in
the absence of the first value which is orders of magnitude greater than
the others.

Is there some way to plot the scree plot for structures 2:n instead of 1:n?

sort of
screeplot (myspca)[2:n]
where n is the number of values?

cheers

Nevil
_______________________________________________
adegenet-forum mailing list
adegenet-forum at lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum


More information about the adegenet-forum mailing list