[adegenet-forum] distribution

Jombart, Thibaut t.jombart at imperial.ac.uk
Thu Apr 15 17:21:53 CEST 2010


Dear Consuelo,

good question about searching in the archives... I don't know (shame on me). My best guess for now is googling a question preceeded by 'adegenet-forum'. For instance, if you google:
"adegenet-forum seppop"
then you find an appropriate discussion in the archives as first answer. Lucky enough, 'adegenet-forum horse riding' does not point to anything in the archives... 
Thanks for pointing this out, I will mention that on the website.

As for your other question: you could read a triangular matrix into R (you can read anything into R, with more or less pain), but a more straightforward way is using 'as.dist' on your rectangular matrix.

M <- matrix(1:9, ncol=3)
M <- M + t(M)
diag(M) <- 0
M # M is a symmetric matrix
     [,1] [,2] [,3]
[1,]    0    6   10
[2,]    6    0   14
[3,]   10   14    0


foo=as.dist(M)
foo # lower triangular matrix
   1  2
2  6   
3 10 14


Best regards

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 Consuelo Hermosilla [cheluna at gmail.com]
Sent: 15 April 2010 14:48
To: adegenet-forum at lists.r-forge.r-project.org
Subject: [adegenet-forum] distribution

Hello Thibaut,

I'd like to know, how can I import a triangular matrix into R? For example, for amova analysis in pegas, the input distance matrix must be triangular. The thing is I have calculated the Fsts in Structure and I wanted to import them to run the Amova in pegas. But I don't know how to convert my square Fst matrix into a triangular one. I could save it as a triangular matrix, but R does not read triangular matrix, does it? Do you know how can I do it?

The other thing, is there a way to search in the past threads of the forum? I mean, instead of search in each month manually?

Thanks!!

Consuelo

-------------
Consuelo Hermosilla
PhD student
Departamento de Ecología y Biología Animal
Departamento de Bioquímica, Genética e Inmunología, Área de Genética
Facultad de Ciencias del Mar
Campus de As Lagoas-Marcosende
Universidad de Vigo
36310 Vigo
SPAIN
Mobile: +34 692 633 298

oooO
(     ) Oooo
   (   (     )
  _)    )  /
        (_/

Stop Gaza Massacre


More information about the adegenet-forum mailing list