[Phylobase-commits] r648 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Sep 14 06:21:09 CEST 2009


Author: regetz
Date: 2009-09-14 06:21:08 +0200 (Mon, 14 Sep 2009)
New Revision: 648

Modified:
   pkg/R/treewalk.R
Log:
in getNode, changed switch statement to an if-else block so that the
call part of the 'missing' warning/error message is less cryptic


Modified: pkg/R/treewalk.R
===================================================================
--- pkg/R/treewalk.R	2009-09-13 19:04:58 UTC (rev 647)
+++ pkg/R/treewalk.R	2009-09-14 04:21:08 UTC (rev 648)
@@ -38,10 +38,11 @@
     if (any(is.na(rval))) {
         missnodes <- node[is.na(rval)]
         msg <- paste("Some nodes are missing from tree: ", paste(missnodes,collapse=", "))
-        switch(missing,
-               fail=stop(msg),
-               warn=warning(msg),
-               OK={})
+        if (missing=="fail") {
+            stop(msg)
+        } else if (missing=="warn") {
+            warning(msg)
+        }
     }
     return(rval)
 }



More information about the Phylobase-commits mailing list