scan error (PR#342)

maechler@stat.math.ethz.ch maechler@stat.math.ethz.ch
Thu, 25 Nov 1999 10:13:53 +0100 (MET)


>>>>> "Jim" == Jim Lindsey <jlindsey@alpha.luc.ac.be> writes:

    Jim> It seems to me the following should work (in fact, it comes from
    Jim> someone's SPlus file). Instead, it reads the first 8 lines and then
    Jim> spits out syntax errors. Using nlines=36 works. Using nmax does not.
    Jim> Intel RH5.2 with R90.0. Debugging shows it must be internal. Jim

Yes, a bug.
This is true with both R versions 0.65 and 0.90 ("R90.0" does *not* exist)

Btw, "nmax" *does* work --- however *not* according to documentation ---

## easier to test if you use a named file instead of stdin) :

> str(j1 <- scan(file="/u/maechler/R/jl-scan.dat",
+            list(i=0,r1=0,r2=0,lull="",day=""),nmax=5*36))
Read 36 lines
List of 5
 $ i   : num [1:36] 1 2 3 4 5 6 7 8 9 10 ...
 $ r1  : num [1:36] 3 1 2 1 1 1 1 0 4 1 ...
 $ r2  : num [1:36] 5 0 4 0 4 0 5 1 1 0 ...
 $ lull: chr [1:36] "no" "yes" "no" "yes" "no" "yes" "no" "yes" "no" "yes" ...
 $ day : chr [1:36] "1" "1" "2" "2" "3" "3" "4" "4" "5" "5" "6" "6" "7" "7" ...


    Jim> junk <- scan(file="",list(i=0,r1=0,r2=0,lull="",day=""),n=5*36)
    Jim> 1   3   5   no   1  
    Jim> 2   1   0  yes   1  
    Jim> 3   2   4   no   2
    Jim> 4   1   0  yes   2  
    Jim> 5   1   4   no   3 
    Jim> 6   1   0  yes   3 
    Jim> 7   1   5   no   4  
    Jim> 8   0   1  yes   4  
    Jim> 9   4   1   no   5  
    Jim> 10   1   0  yes   5   
    Jim> 11   4   5   no   6 
    Jim> 12   1   0  yes   6  
    Jim> 13   5   3   no   7  
    Jim> 14   1   0  yes   7  
    Jim> 15   4   4   no   8  
    Jim> 16   1   0  yes   8 
    Jim> 17   3   2   no   9  
    Jim> 18   1   0  yes   9  
    Jim> 19   8   1   no  10  
    Jim> 20   0   1  yes  10   
    Jim> 21   5   1   no  11   
    Jim> 22   1   0  yes  11  
    Jim> 23   8   1   no  12 
    Jim> 24   1   0  yes  12  
    Jim> 25   5   3   no  13 
    Jim> 26   1   0  yes  13  
    Jim> 27   4   1   no  14  
    Jim> 28   1   0  yes  14  
    Jim> 29   4   2   no  15  
    Jim> 30   1   0  yes  15  
    Jim> 31   7   1   no  16 
    Jim> 32   1   0  yes  16  
    Jim> 33   4   2   no  17  
    Jim> 34   0   1  yes  17  
    Jim> 35   5   3   no  18 
    Jim> 36   1   0  yes  18  


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._