Re: [Rd] possible bug in co.intervals when overlap=0

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Sat 16 Dec 2006 - 07:01:51 GMT

This happens equally when overlap = 0.5 (the default).

Yes, it is a bug. R does xr <- x[r + ii] with fractional r.

On Fri, 15 Dec 2006, Benjamin Tyner wrote:

> I apologize if this is just a misunderstanding on my part, but I was
> under the impression that the intervals returned by co.intervals should
> cover all the observations. Yet
>
> x<-1:10
> z<-co.intervals(x,overlap=0)
>
> In R, z equals
> [,1] [,2]
> [1,] 0.5 1.5
> [2,] 2.5 3.5
> [3,] 3.5 4.5
> [4,] 5.5 6.5
> [5,] 7.5 8.5
> [6,] 8.5 9.5

>
> Note in particular the second and last element of x are not covered by
> any of the intervals. In fact S-PLUS gives
> [,1] [,2]
> [1,] 1 2
> [2,] 3 3
> [3,] 4 5
> [4,] 6 7
> [5,] 8 8
> [6,] 9 10

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Sun Dec 17 01:32:50 2006

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 Sat 16 Dec 2006 - 15:31:03 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.