[adegenet-forum] Regarding s.value improvement and PCA whats d=n

Jombart, Thibaut t.jombart at imperial.ac.uk
Wed Apr 25 13:13:59 CEST 2012


Hello, 

yes s.value suffers from this problem. The advantage of 'symbols' over 'points' is that the size of the symbols is consistent with the values provided, while values of 'cex' do not provide linear scales for the symbols. 

Have you looked at the function 'colorplot'? It is a good alternative to s.value when there are many overlapping points. 

As a side note, the entire graphics of ade4 are being reformed at the moment, so expect a lot of improvements of the s.[...] functions for the next release of ade4.

Cheers

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 Roy Francis Mathew [RoyFrancis.Mathew at agrsci.dk]
Sent: 25 April 2012 11:55
To: 'adegenet-forum at lists.r-forge.r-project.org'
Subject: [adegenet-forum] Regarding s.value improvement and PCA whats d=n

Hi Jombart,
I have a suggestion regarding s.value to plot the squares plot for sPCA. One issue is that if samples are very close geographically the squares overlap. White squares have black borders which is good, but the black squares have white edges which is confusing. It becomes difficult to say of samples are overlapping or its just the border around it. I dug into the function and found that it plots using symbols(). I don’t know whats the advantage of using symbols() over just points().

I have tried to change this to points() and this works a lot better. Sample script from the region.

##
csize=1
sq1<-rescale(sq,c(csize,csize+3))

for (i in 1:(nrow(data.frame(dfxy)))) {
            if (sign(z[i]) >= 0) {
                #symbols(coo$x[i], coo$y[i], squares = sq[i], bg = "black", fg = "white", add = TRUE, inch = FALSE)
                             points(coo$x[i], coo$y[i],col="red",cex=sq1[i],pch=15)
            }
            else {
                #symbols(coo$x[i], coo$y[i], squares = sq[i], bg = "white", fg = "black", add = TRUE, inch = FALSE)
                             points(coo$x[i], coo$y[i],col="blue",cex=sq1[i],pch=15)
            }
        }
##

Firstly it doesn’t have this background and foreground problem with symbols. Second, it can be any two user defined colours. Third it can be any pch, doesn’t have to be square. I could see from the function that you were planning to incorporate circles.

##
else if (method == "circlesize") {
        print("not yet implemented")
    }
##

On a different matter, what is d=2, that I see on the top right corner of s.class() PCA plots?

Kind regards
Roy Mathew Francis
Ph.D. Fellow

Dept. of Agroecology
Aarhus University
Forsøgsvej 1
DK-4200 Slagelse


Tel.: +45 8715 8131
Email: RoyFrancis.Mathew at agrsci.dk


Tel.: +45 8715 6000
Web: www.agrsci.au.dk

[Logo]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 9975 bytes
Desc: image001.jpg
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20120425/fb67313e/attachment.jpg>


More information about the adegenet-forum mailing list