[adegenet-forum] distribution

Consuelo Hermosilla cheluna at gmail.com
Wed Apr 21 13:36:08 CEST 2010


Hi Thibaut!
I'm remembering what you say "*you can read anything into R, with more or
less pain*"... I'm experiencing some pain with dists again... Here is the
thing. I have a bootstraped file with 1000 dist matrices from AFLPsurv...
but they are square matrices... grrr.... I cannot use the as.dist function
directly to transform them to triangular matrices. How can I do it? Do I
need a loop? And then, if I manage it, how can I export them? I tried to
export a single triangle matrix (using write.table) and it says "cannot
coerce class "dist" into a data.frame"... Tricky...
My last question (hopefully) is related to this an to my previous monmonier
question. Can I use this bootstraped file (if I manage to convert it) as the
dist object for the monmonier function?
Thank you very much!!!

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


On Thu, Apr 15, 2010 at 5:21 PM, Jombart, Thibaut
<t.jombart at imperial.ac.uk>wrote:

> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20100421/21b3eff9/attachment.htm 


More information about the adegenet-forum mailing list