-## read.dna.R (2011-02-01)
+## read.dna.R (2012-04-26)
## Read DNA Sequences in a File
-## Copyright 2003-2011 Emmanuel Paradis
+## Copyright 2003-2012 Emmanuel Paradis
## This file is part of the R-package `ape'.
## See the file ../COPYING for licensing issues.
skip = skip, nlines = nlines, comment.char = comment.char)
pat.base <- "[-AaCcGgTtUuMmRrWwSsYyKkVvHhDdBbNn?]{10}"
if (phylip) {
- ## need to remove the possible leading spaces in the first line
- fl <- gsub("^ +", "", X[1])
- fl <- as.numeric(unlist(strsplit(fl, " +")))
+ ## need to remove the possible leading spaces and/or tabs in the first line
+ fl <- gsub("^[[:blank:]]+", "", X[1])
+ fl <- as.numeric(unlist(strsplit(fl, "[[:blank:]]+")))
if (length(fl) != 2 || any(is.na(fl)))
stop("the first line of the file must contain the dimensions of the data")
n <- fl[1]