Looks like this may be because your row names in your data frame have spaces, while your tree tip labels do not.

Try:

rownames(example)<-sub(" ","",rownames(example))
example<-example[tree$tip.label,]

Help?

- Liam

--
Liam J. Revell
University of Massachusetts Boston
web: http://faculty.umb.edu/liam.revell/
email: liam.rev...@umb.edu
blog: http://phytools.blogspot.com

On 5/9/2012 5:13 PM, Agus Camacho wrote:
Dear all,

I had the same problem as T. Gamble and tried the advice from L. Revell
and Rich over my own tree  (attached), all of the hints produced a df
with Nas. Also, I cant see any difference between rownames on my matrix
and tree tip labels...

Could anyone give me a hint about what i am doing wrong here?

Thanks in advance,

Agus
PS: There it goes what I did:

First from Liam's hint:


example<- read.csv("example.csv",header=TRUE,row.names=1)
 example
                   vara varb
C. leiolepis         1    a
C. nicterus          2    b
C. sinebrachiatus    3    c
S. catimbau          4    a
N. ablephara         5    b
P. erythrocercus     6    c
P. tetradactylus     7    a
V. rubricauda        8    b
V. rubricaudavac     9    c
M. maximiliani      10    a
P. paeminosus       11    b
 tree$tip.label
  [1]"C.leiolepis"       "C.nicterus"        "C.sinebrachiatus"  "S.catimbau"
  [5]"N.ablephara"       "P.erythrocercus"   "P.tetradactylus"   "V.rubricauda"
  [9]"V.rubricaudavac"   "M.maximiliani"     "P.paeminosus"
 example<-example[tree$tip.label,]
 example
       vara varb
NA      NA<NA>
NA.1    NA<NA>
NA.2    NA<NA>
NA.3    NA<NA>
NA.4    NA<NA>
NA.5    NA<NA>
NA.6    NA<NA>
NA.7    NA<NA>
NA.8    NA<NA>
NA.9    NA<NA>
NA.10   NA<NA>


Now, Rich's hint:


match(tree$tip.label, rownames(example)) ->   match
 match
  [1] NA NA NA NA NA NA NA NA NA NA NA



--

Agustín Camacho Guerrero.
Doutorando em Zoologia.
Laboratório de Herpetologia, Departamento de Zoologia, Instituto de
Biociências, USP.
Rua do Matão, trav. 14, nº 321, Cidade Universitária,
São Paulo - SP, CEP: 05508-090, Brasil.



_______________________________________________
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo

_______________________________________________
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo

Reply via email to