[Genabel-commits] r622 - pkg/GenABEL/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Nov 19 06:55:20 CET 2010


Author: stiv
Date: 2010-11-19 06:55:19 +0100 (Fri, 19 Nov 2010)
New Revision: 622

Modified:
   pkg/GenABEL/R/impute2databel.R
Log:
better info on bad header

Modified: pkg/GenABEL/R/impute2databel.R
===================================================================
--- pkg/GenABEL/R/impute2databel.R	2010-11-09 19:11:45 UTC (rev 621)
+++ pkg/GenABEL/R/impute2databel.R	2010-11-19 05:55:19 UTC (rev 622)
@@ -114,7 +114,14 @@
 	
 	if (!missing(samplefile))
 	{
-		temp <- scan(samplefile,what="character",nlines=1)
+		l1 <- scan(samplefile,what="character",nlines=1)
+		l2 <- scan(samplefile,what="character",nlines=1,skip=1)
+		temp <- scan(samplefile,what="character",nlines=1,skip=2)
+
+		if((length(l1)!=length(temp)) || (length(temp)!=length(l2))){
+            warning("Wrong number of words in sample file's header.");
+		}		
+
 		samnames <- scan(samplefile,what="character",skip=2)
 		samnames <- samnames[c(F,T,rep(F,(length(temp)-2)))]
 		if (length(samnames) == dim(dosefile)[1]) { 



More information about the Genabel-commits mailing list