R/my_read.nexus.R

Defines functions my_read.nexus

my_read.nexus <- function(file){

#LISTE  <- read.nexus.data(file)
LISTE  <- APE_read.nexus.data(file) #Copyright APE package on CRAN  !
size   <- length(LISTE)

MAT <- NULL

for(xx in 1:size){

MAT <- rbind(MAT,LISTE[[xx]])

} 

if(is.element(".",MAT)){
 value  <- apply(MAT,2,function(x){
   x[x=="."] <- x[1]
   return(x)
 })
 MAT <- value
}

rownames(MAT) <- names(LISTE)
return(MAT) 

}

Try the PopGenome package in your browser

Any scripts or data that you put into this service are public.

PopGenome documentation built on Feb. 1, 2020, 1:07 a.m.