Skip to content
Prev 9022 / 63424 Next

sample (PR#2546)

On 25 Feb 2003 at 19:05, Patrick Burns wrote:

            
I thought about this. It would be nice to have the behaviour Patrick 
Burns proposes, but there is a problem: What to do when the 
length one argument is numeric? Look at the following:
[1] 1
[1] 4 6 1 5 2 3 7
[1] 2 4 5 1 3 6   # 6.9 truncated to 6
[1] 0                #  What one should expect here is not easy to 
                      #  know, as the help page requires a positive
                      #  integer
[1] -3              # same
[1] 0.5
[1] 1               # truncated

So what to do with length one numerical arguments, truncate, as seems 
to be done (but not always):
[1] 0.99

or round, or give an error if not a positive integer, or? 
However it is done it will surely break some code. 

Kjetil Halvorsen