[Seqinr-commits] r1612 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jun 17 16:56:17 CEST 2009


Author: lobry
Date: 2009-06-17 16:56:16 +0200 (Wed, 17 Jun 2009)
New Revision: 1612

Modified:
   pkg/R/readPanels.R
Log:
deletion of runs of tabulations

Modified: pkg/R/readPanels.R
===================================================================
--- pkg/R/readPanels.R	2009-04-27 19:43:00 UTC (rev 1611)
+++ pkg/R/readPanels.R	2009-06-17 14:56:16 UTC (rev 1612)
@@ -11,10 +11,15 @@
   stops  <- c(iPanel[-1] - 1, length(src))
   
   for(i in seq_len(length(iPanel))){
-	 mycon <- textConnection(src[starts[i]:stops[i]])
+  	 toimport <- src[starts[i]:stops[i]]
+  	 # Change all runs of tabulations by a single one:
+  	 toimport <- gsub("\t{2,}", "\t", toimport)
+	 mycon <- textConnection(toimport)
     result[[i+1]] <- read.table(mycon, sep = "\t", quote = "")
     close(mycon)
     # remove empty columns
+    # (I guess this is no more necessary now that runs of
+    # tabulation are preprocessed)
     tokeep <- rep(TRUE, ncol(result[[i+1]]))
     for(j in 1:ncol(result[[i+1]])){
       if(all(is.na(result[[i+1]][,j]))){



More information about the Seqinr-commits mailing list