X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=R%2FDNA.R;h=c751c5088812c96c893666233c83db0db91ff906;hb=5de3d16fdc60bcbab2ae04933bca4ab931ed48f8;hp=72e12582617e0927bdc5d9a2a884d5784b6c46fb;hpb=b9f8872e29c6dbda44f60f67b9797dd90a119de6;p=ape.git diff --git a/R/DNA.R b/R/DNA.R index 72e1258..c751c50 100644 --- a/R/DNA.R +++ b/R/DNA.R @@ -1,4 +1,4 @@ -## DNA.R (2009-09-18) +## DNA.R (2009-10-02) ## Manipulations and Comparisons of DNA Sequences @@ -292,7 +292,10 @@ dist.dna <- function(x, model = "K80", variance = FALSE, gamma = FALSE, { MODELS <- c("RAW", "JC69", "K80", "F81", "K81", "F84", "T92", "TN93", "GG95", "LOGDET", "BH87", "PARALIN", "N") - imod <- which(MODELS == toupper(model)) + imod <- pmatch(toupper(model), MODELS) + if (is.na(imod)) + stop(paste("'model' must be one of:", + paste("\"", MODELS, "\"", sep = "", collapse = " "))) if (imod == 11 && variance) { warning("computing variance temporarily not available for model BH87.") variance <- FALSE