Re: [R] Operator proposal: %between%

2014-09-05 Thread Barry Rowlingson
On Fri, Sep 5, 2014 at 12:28 AM, David Winsemius dwinsem...@comcast.net wrote: If you are accepting feature requests The R issue tracker has a wishlist section:

Re: [R] Operator proposal: %between%

2014-09-05 Thread Torbjørn Lindahl
Please add it if you think it fits, and expand it as discussed, I am not creating a package for one single utility function. T. On Fri, Sep 5, 2014 at 1:28 AM, David Winsemius dwinsem...@comcast.net wrote: On Sep 4, 2014, at 12:54 PM, Greg Snow wrote: The TeachingDemos package has %% and

Re: [R] Operator proposal: %between%

2014-09-05 Thread Gabor Grothendieck
On Thu, Sep 4, 2014 at 10:41 AM, Torbjørn Lindahl torbjorn.lind...@gmail.com wrote: Not sure if this is the proper list to propose changes like this, if it passes constructive criticism, it would like to have a %between% operator in the R language. There is a between function in the

Re: [R] Operator proposal: %between%

2014-09-05 Thread Torbjørn Lindahl
I don't mind maintaining this, however I'm not creating a new util package just for one function, there are already several nice util libraries out there, adding one more adds to fragmentation more than this single function provides usefulness. If anyone wants to adopt this low-maintenance-cost

Re: [R] Operator proposal: %between%

2014-09-05 Thread Duncan Murdoch
On 05/09/2014, 6:47 AM, Torbjørn Lindahl wrote: I don't mind maintaining this, however I'm not creating a new util package just for one function, there are already several nice util libraries out there, adding one more adds to fragmentation more than this single function provides usefulness.

Re: [R] Operator proposal: %between%

2014-09-05 Thread Hadley Wickham
Please add it if you think it fits, and expand it as discussed, I am not creating a package for one single utility function. Why not? There's nothing wrong with a package that only provides one function. Hadley -- http://had.co.nz/ __

Re: [R] Operator proposal: %between%

2014-09-05 Thread William Dunlap
You can easily run into precedence problems with the %fun% syntax. E.g., if 1 %% 5 %% 10 returns TRUE then 1 %% 5 %% 10*2 will return 2 because %% has higher precedence than *. as.list(quote(1 %% 5 %% 10*2)) [[1]] `*` [[2]] 1 %% 5 %% 10 [[3]] [1] 2

[R] Operator proposal: %between%

2014-09-04 Thread Torbjørn Lindahl
Not sure if this is the proper list to propose changes like this, if it passes constructive criticism, it would like to have a %between% operator in the R language. I currently have this in my local R startup script: `%between%` - function(x,...) { y - range( unlist(c(...)) ) return( x =

Re: [R] Operator proposal: %between%

2014-09-04 Thread Duncan Murdoch
On 04/09/2014 10:41 AM, Torbjørn Lindahl wrote: Not sure if this is the proper list to propose changes like this, if it passes constructive criticism, it would like to have a %between% operator in the R language. But it appears that you do: I currently have this in my local R startup script:

Re: [R] Operator proposal: %between%

2014-09-04 Thread Greg Snow
The TeachingDemos package has %% and %=% operators for a between style comparison. So for your example you could write: 1 %% 5 %% 10 or 1 %=% 5 %=% 10 And these operators already work with vectors: lb %=% x %% ub and can even be further chained: 0 %% x %% y %% z %% 1 # only points where x

Re: [R] Operator proposal: %between%

2014-09-04 Thread David Winsemius
On Sep 4, 2014, at 12:54 PM, Greg Snow wrote: The TeachingDemos package has %% and %=% operators for a between style comparison. So for your example you could write: 1 %% 5 %% 10 or 1 %=% 5 %=% 10 And these operators already work with vectors: lb %=% x %% ub and can even be