X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=R%2Fnjs.R;h=4345bfe34e925c8fc8843c794a21e90567c2087f;hb=1df144a18356d9b329324324bc2f78cfdf1cea3d;hp=1f7ee8a85aca4c486b7b50710ce3fab5f39768ec;hpb=ef34642fe85694df0a80ef534137b8f6b427b67e;p=ape.git diff --git a/R/njs.R b/R/njs.R index 1f7ee8a..4345bfe 100644 --- a/R/njs.R +++ b/R/njs.R @@ -1,4 +1,4 @@ -## njs.R (2011-10-11) +## njs.R (2012-03-30) ## Tree Reconstruction from Incomplete Distances With NJ* or bio-NJ* @@ -9,6 +9,8 @@ .NJS_BIONJS <- function(libs, X, fs = 15) { + if (fs < 1) + stop("argument 'fs' must be a non-zero positive integer") if (is.matrix(X)) X <- as.dist(X) X[is.na(X)] <- -1 X[X < 0] <- -1