R/bpec.load.R

Defines functions bpec.loadSeq bpec.loadCoords

Documented in bpec.loadCoords bpec.loadSeq

bpec.loadSeq = function(seqsFile) {
  rawSeqs = read.nexus.data(seqsFile)
  return(rawSeqs)
}

bpec.loadCoords = function(coordsFile, header = FALSE) {
    coordsLocs = read.table(coordsFile, header = FALSE, fill = TRUE)
    
    if(header == TRUE) {
        names(coordsLocs) = as.character(unlist(as.matrix(coordsLocs[1, ])))
        coordsLocs = coordsLocs[-1, ]
    }
   coordsLocs = apply(coordsLocs, 2, as.numeric)
 return(coordsLocs)
}

Try the BPEC package in your browser

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

BPEC documentation built on March 2, 2020, 1:07 a.m.