[Seqinr-commits] r2109 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Jan 15 12:43:36 CET 2021


Author: simonpenel
Date: 2021-01-15 12:43:36 +0100 (Fri, 15 Jan 2021)
New Revision: 2109

Modified:
   pkg/R/s2n.R
Log:
Sequence check modification according to M. A. Birk suggestion

Modified: pkg/R/s2n.R
===================================================================
--- pkg/R/s2n.R	2020-12-17 09:59:22 UTC (rev 2108)
+++ pkg/R/s2n.R	2021-01-15 11:43:36 UTC (rev 2109)
@@ -10,7 +10,9 @@
   #
   # Check that sequence is a vector of chars:
   #
-  if(nchar(seq[1]) > 1) stop("sequence is not a vector of chars")
+  if(!is.na(seq[1])){
+    if(nchar(seq[1]) > 1) stop("sequence is not a vector of chars")
+  }
   #
   # Force to lower-case letters if requested:
   #
@@ -20,4 +22,4 @@
     unclass(factor(seq, levels = levels ) ) - 1
   else
     unclass(factor(seq, levels = levels ) )
-}
\ No newline at end of file
+}



More information about the Seqinr-commits mailing list