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
150_BootstrapConsensusTree_Cantabrian_ML.nwk
Description: Binary data
LOC Amblystegium serpens Amblystegium subtile Anomodon attenuatus Anomodon viticulosus Apometzgeria pubescens Brachythecium populeum Brachythecium velutinum Bryum moravicum Cf. Hypnum sp. Cryphaea heteromalla Scleropodium cespitans Eurhynchium sp. Kindbergia praelonga Frullania dilatata Frullania tamarisci Homalothecium sericeum Hypnum cupressiforme var. cupressiforme Hypnum cupressiforme var. filiforme Hypnum recurvatum Hypnum revolutum Isothecium alopecuroides Jungermannia sp. Leptodon smithii Leucodon sciuroides Lejeunea cavifolia Lophocolea bidentata Metzgeria furcata Mnium stellare Neckera besseri Neckera complanata Neckera crispa Orthotrichum affine Orthotrichum lyellii Orthotrichum speciosum Orthotricum rupestre Orthotrichum sp. Orthotrichum pallens Orthotrichum stramineum Orthotrichum striatum Othotrichum aff. schimperi Orthotrichum tenellum Plagiochila porelloides Plagiothecium nemorale Porella arboris-vitae Porella platyphylla Pseudoleskeella nervosa Pterigynandrum filiforme Radula complanata Rhynchostegiella curviseta Scleropodium cespitans Thuidium delicatulum Tortella flavovirens var. flavovirens Ulota crispa Tortella tortuosa La Preste 0.5 0 0 0 12 0 0 0.5 0 0 0 6 2 377 0 0 0 23.5 18 0 0 1 0 3 0 0 8 0 0 0 0 65 0 76 52 107 41 0 139.5 21 0 5 0 0 157 250 157.5 35.5 0 8 17 0 0 1.5 Toran 30 46 305 148 0 8 6 1.5 0 0 0 8 0 451 49 491 28 27 102 0 669 0 0 163 1 0 171 1 0 1052.5 0 5 0 0 13 58.5 0 25 24 0 3.5 5 30 0 701 6 504.5 332 24 0 0 0 41.5 0 Els Ports 0 60 0 0 0 0 10 0 20 8 0 0 0 465.5 12 126 0 65 45 6 0 2 181 0 30 3 538 0 37.5 2434.5 84 44.5 3 0 0 46.5 6 5 45 0 0 21.5 0 100 56 0 82 180 0 0 0 0 0 0
_______________________________________________ R-help-es mailing list [email protected] https://stat.ethz.ch/mailman/listinfo/r-help-es
