Re: [Rd] findInterval

2024-09-17 Thread Gabor Grothendieck
The other problem in this example is setting NA's. replace(x, x == 0, NA) requires two instances of x making it not very pipe friendly. In dplyr there is na_if to address that problem and base R might have something that addresses this so we don't have to define our own zero2na as the base of

Re: [Rd] findInterval

2024-09-17 Thread Martin Maechler
> Gabor Grothendieck > on Mon, 16 Sep 2024 11:21:55 -0400 writes: > Suppose we have `dat` shown below and we want to find the the `y` value > corresponding to the last value in `x` equal to the corresponding component > of `seek` and we wish to return an output the same l

[Rd] findInterval

2024-09-16 Thread Gabor Grothendieck
Suppose we have `dat` shown below and we want to find the the `y` value corresponding to the last value in `x` equal to the corresponding component of `seek` and we wish to return an output the same length as `seek` using `findInterval` to perform the search. This returns the correct result: d

Re: [Rd] findInterval Documentation Suggestion

2020-03-06 Thread Marc Schwartz via R-devel
> On Mar 6, 2020, at 9:17 AM, brodie gaslam via R-devel > wrote: > >> On Friday, March 6, 2020, 8:56:54 AM EST, Martin Maechler >> wrote: > >> Note that the * -> LaTex -> PDF rendered version looks a bitnicer. > > Ah yes, that does indeed look quite a bit nicer. > >> I wrote the functio

Re: [Rd] findInterval Documentation Suggestion

2020-03-06 Thread brodie gaslam via R-devel
> On Friday, March 6, 2020, 8:56:54 AM EST, Martin Maechler > wrote: > Note that the  * -> LaTex -> PDF rendered version looks a bitnicer. Ah yes, that does indeed look quite a bit nicer. > I wrote the function and that help page originally. And thank you for doing so. It is a wonderful fu

Re: [Rd] findInterval Documentation Suggestion

2020-03-06 Thread Martin Maechler
> brodie gaslam via R-devel > on Thu, 5 Mar 2020 22:18:33 + (UTC) writes: > I've found over time that R documentation that comes off as terse at > first blush is usually revealed to be precise, concise, and complete > on close reading.  I'm sure this is also true of `?

Re: [Rd] findInterval Documentation Suggestion

2020-03-05 Thread brodie gaslam via R-devel
Trying the attachment as .txt instead of Rd. On Thursday, March 5, 2020, 5:20:25 PM EST, brodie gaslam via R-devel wrote: % File src/library/base/man/findInterval.Rd % Part of the R package, https://www.R-project.org % Copyright 1995-2020 R Core Team % Distributed under GPL 2 or later \name

[Rd] findInterval Documentation Suggestion

2020-03-05 Thread brodie gaslam via R-devel
I've found over time that R documentation that comes off as terse at first blush is usually revealed to be precise, concise, and complete on close reading.  I'm sure this is also true of `?findInterval`, but for whatever reason my brain simply refuses to extract meaning from it. Part of the proble

Re: [Rd] findInterval(all.inside=TRUE) for degenerate 'vec' arguments

2016-08-05 Thread Martin Maechler
> William Dunlap via R-devel > on Thu, 4 Aug 2016 15:20:57 -0700 writes: > What should findInterval(x,vec,all.inside=TRUE) return when length(vec)<=1, > so there are no inside intervals? > R-3.3.0 gives a decreasing map of x->output when length(vec)==1 and -1's > whe

[Rd] findInterval(all.inside=TRUE) for degenerate 'vec' arguments

2016-08-04 Thread William Dunlap via R-devel
What should findInterval(x,vec,all.inside=TRUE) return when length(vec)<=1, so there are no inside intervals? R-3.3.0 gives a decreasing map of x->output when length(vec)==1 and -1's when length(vec)==0. Would '0' in all those cases be better? > findInterval(x=c(10, 11, 12), vec=11, all.inside=T