[R-es] ERROR: subscript out of bounds

nuria bs laptepo en hotmail.com
Mie Jul 22 10:40:27 CEST 2015


Buenas, 

Cuando intento ejecutar el siguiente codigo, me aparece el error " Error in dist.mat[com.names, com.names] : subscript out of bounds". Porque me aparece este error? Y como puedo solucionarlo? 
Gracias!!!

CONSOLE:
> my.phylo<-read.tree("150_BootstrapConsensusTree_Cantabrian_ML.nwk")
> my.sample <- read.delim("C:/Filogenia/my.sample.txt")
> my.sample<-read.table("my.sample.txt",sep="\t", header=T, row.names=1)

> library(SDMTools)

> sntd.a.function <- function(x){
   com.names <- names(x[x > 0])                        # Get de names of the species present in a community
   my.com.dist <- dist.mat[com.names, com.names]       # Distance matrix
   diag(my.com.dist) = NA                              # Diagonal values to NA -> Matriz sim, diagonal zero
   wt.sd(apply(my.com.dist,1,min,na.rm=T), x[x>0])     
 }

> dist.mat<-cophenetic(my.phylo)
> proba<-apply(my.sample, MARGIN = 1, sntd.a.function)

Error in dist.mat[com.names, com.names] : subscript out of bounds 		 	   		  
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <https://stat.ethz.ch/pipermail/r-help-es/attachments/20150722/74cc2a03/attachment.html>
------------ próxima parte ------------
A non-text attachment was scrubbed...
Name: 150_BootstrapConsensusTree_Cantabrian_ML.nwk
Type: application/octet-stream
Size: 1159 bytes
Desc: no disponible
URL: <https://stat.ethz.ch/pipermail/r-help-es/attachments/20150722/74cc2a03/attachment.obj>
------------ próxima parte ------------
An embedded and charset-unspecified text was scrubbed...
Name: my.sample.txt
URL: <https://stat.ethz.ch/pipermail/r-help-es/attachments/20150722/74cc2a03/attachment.txt>


Más información sobre la lista de distribución R-help-es