R/bpec.load.R

Defines functions bpec.loadCoords bpec.loadSeq

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 Aug. 30, 2018, 1:03 a.m.