[Roxygen-commits] r214 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jan 29 19:34:12 CET 2009


Author: pcd
Date: 2009-01-29 19:34:12 +0100 (Thu, 29 Jan 2009)
New Revision: 214

Modified:
   pkg/R/string.R
Log:
change is.null.string to handle NA (bug?)


Modified: pkg/R/string.R
===================================================================
--- pkg/R/string.R	2009-01-21 01:29:44 UTC (rev 213)
+++ pkg/R/string.R	2009-01-29 18:34:12 UTC (rev 214)
@@ -33,8 +33,10 @@
 #' Does the string contain no matter, but very well [:space:]?
 #' @param string the string to check
 #' @return TRUE if the string contains words, otherwise FALSE
-is.null.string <- function(string)
-  regexpr(MATTER, string) < 0
+is.null.string <- function(string) {
+  if (is.na(string)) FALSE
+  else regexpr(MATTER, string) < 0
+}
 
 #' Number of words a string contains.
 #' @param string the string whose words to count



More information about the Roxygen-commits mailing list