R-alpha: Three bugs + two fixes

Martyn Plummer (plummer@iarc.fr)
Wed, 26 Feb 1997 09:25:11 +0100 (MET)


Date: Wed, 26 Feb 1997 09:25:11 +0100 (MET)
From: Martyn Plummer <plummer@iarc.fr>
To: r-testers@stat.math.ethz.ch
Subject: R-alpha: Three bugs + two fixes

1) Trying to restrict the number of items read by scan() using the
"nmax" or "nlines" parameters doesn't work when "what" is a list.
The problem, which lies in the C function scanFrame, can be fixed by
this patch to scan.c

333c333,335
<                       if(maxlines > 0 && (linesread == maxlines || nc*line
sread >= maxitems))
---
>                       if(maxitems > 0 && nc*linesread >= maxitems)
>                               goto done;
>                       if(maxlines > 0 && linesread == maxlines)

NB This results in behaviour by "nmax" which is consistent with the "n"
parameter in S-PLUS but not with the R help page.

2) In the interpreted code for apply(), "dlen" should be renamed to "dl".
This bug stops you from using apply on a data frame.

3) is.na() treats data frames as lists. It always returns a vector of FALSE
values with the same length as the names attribute.

Martyn
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-testers mailing list -- For info or help, send "info" or "help",
To [un]subscribe, send "[un]subscribe"
(in the "body", not the subject !)  To: r-testers-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-