[R] approx with ties = 'ordered'

From: Vadim Ogranovich <vograno_at_yahoo.com>
Date: Mon 02 Apr 2007 - 21:37:05 GMT


Hi,

I am a bit surprised how approx resolves ties when ties = 'ordered'. In the following two examples I'd expect the first expression to return 1 (not 2).

The documentation reads that "that 'f=0' is right-continuous and 'f=1' is left-continuous" so one would expect the argument to matter when resolving ties.

Thanks,
Vadim

-> approx(c(1,1), seq(2), 1, method = "const", rule = 2, f = 1, yleft = NA, ties
= "ordered")$y
[1] 2
-> approx(c(1,1), seq(2), 1, method = "const", rule = 2, f = 0, yleft = NA, ties
= "ordered")$y
[1] 2

-> version

               _                           
platform       i486-pc-linux-gnu           
arch           i486                        
os             linux-gnu                   
system         i486, linux-gnu             
status                                     
major          2                           
minor          4.1                         
year           2006                        
month          12                          
day            18                          
svn rev        40228                       
language       R                           
version.string R version 2.4.1 (2006-12-18)

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Tue Apr 03 22:31:45 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 03 Apr 2007 - 13:30:43 GMT.

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