R-alpha: missing warning message

Ross Ihaka ihaka@stat.auckland.ac.nz
Fri, 23 May 1997 08:03:56 +1200 (NZST)


> In R it is possible to write nonsense 

> R> 0.5:4:3:9:8:5
> [1] 0.5 1.5 2.5 3.5 4.5

> and never be warned about it, Splus does the expected thing:

> Splus> 0.5:4:3:9:8:5
> [1] 0.5 1.5 2.5 3.5 4.5
> Warning messages:
> 1: Numerical expression has 4 elements: only the first used in: 0.5:4:3
> 2: Numerical expression has 3 elements: only the first used in: 0.5:4:3:9
> 3: Numerical expression has 9 elements: only the first used in: 0.5:4:3:9:8
> 4: Numerical expression has 8 elements: only the first used in: 0.5:4:3:9:8:5

I'll put a warning in, but ...

This is one place where the recycling rule is violated.  I've thought
for a while about implementing

	m : n

in the following way

	c(m[1]:n[1] , m[2]:n[2] , ...)

with the shorter argument being recycled out to the length of the longer
one.  I have seen at least one application where this extended could
be used.
	Ross
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
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
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-