[Rd] Out of bounds negative index

From: Vincent Goulet <vincent.goulet_at_act.ulaval.ca>
Date: Fri, 02 May 2008 15:23:47 -0400


Hi,

 From the R Language Definition, Section 3.4.1:

"If i is positive and exceeds length(x) then the corresponding selection is NA. A negative out of bounds value for i causes an error."

(This is also mentioned in S Programming, footnote of page 24.)

Can someone please provide an example triggering the error? Looking in src/main/subscript.c I could not find exception handling for |i| > length(x), unless the negative subscript is mixed with NAs. In other cases, out of bounds negative indexes just seem silently ignored.

Did I missed or misinterpreted something, here?

Thanks in advance

---
   Vincent Goulet, Associate Professor
   École d'actuariat
   Université Laval, Québec
   Vincent.Goulet@act.ulaval.ca   http://vgoulet.act.ulaval.ca

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Fri 02 May 2008 - 19:28:15 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 02 May 2008 - 20:32:49 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive