[R] cut with intervals open on the right?

Pedro de Barros pbarros at ualg.pt
Fri Oct 19 13:03:33 CEST 2007

Thanks for the quick and nice reply.
I must apologise twice:
1-I should have reported I am using R 2.5.1 on Windows;
2- It was a spelling error on my part (rigth instead of right).


At 11:27 2007/10/19, you wrote:
>Works for me with current R-2.6.0 (but you haven't told us about 
>your R version!):
> > cut(1:5, 1:5)
>[1] <NA>  (1,2] (2,3] (3,4] (4,5]
>Levels: (1,2] (2,3] (3,4] (4,5]
> > cut(1:5, 1:5, right=FALSE)
>[1] [1,2) [2,3) [3,4) [4,5) <NA>
>Levels: [1,2) [2,3) [3,4) [4,5)
>Uwe Ligges
>Pedro de Barros wrote:
>>Dear All,
>>I am trying to use cut() to produce intervals open on the right, 
>>but it seems to ignore the argument right=F, contrary to what is 
>>indicated on the help for cut.
>>Can anyone help?
>>R-help at r-project.org mailing list
>>PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>>and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list