similar to: findInterval in compiled code.

Displaying 20 results from an estimated 7000 matches similar to: "findInterval in compiled code."

2016 Aug 04
1
findInterval(all.inside=TRUE) for degenerate 'vec' arguments
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=TRUE, rightmost.closed=FALSE, left.open=FALSE) [1] 1 0 0 >
2011 Dec 06
1
help wrapping findInterval into a function
Dear R Community, I hope you might be able to assist with a small problem creating a function. I am working with water-quality data sets that contain the concentration of many different elements in water samples. I need to assign quality-control flags to values that fall into various concentration ranges. Rather than a web of nested if statements, I am employing the findInterval function to
2024 Sep 16
1
findInterval
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: dat <- data.frame(x = c(2, 2, 3, 4, 4, 4), y = c(37, 12, 19, 30, 6, 15), seek = 1:6)
2024 Sep 17
1
findInterval
>>>>> 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 length as `seek` using > `findInterval` to perform the
2010 Jul 12
2
findInterval and data resolution
Hello Wise Ones... I need a clever way around a problem with findInterval. Consider: vec1 <- 1:10 vec2 <- seq(1, 10, by = 0.1) x1 <- c(2:3) a1 <- findInterval(x1, vec1); a1 # example 1 a2 <- findInterval(x1, vec2); a2 # example 2 In the problem I'm working on, vec* may be either integer or numeric, like vec1 and vec2. I need to remove one or more sections of this vector;
2008 Sep 22
1
findInterval(), binary search, log(N) complexity
Dear R users, the help for findInterval(x,vec) suggests a logarithmic dependence on N (=length(vec)), which would imply a binary search type algorithm. However, when I "test" this hypothesis, in the following manner: set.seed(-3645); l <- vector(); N.seq <- c(5000, 500000, 1000000, 10000000, 50000000);k <- 1 for (N in N.seq){ tmp <- sort(round(stats::rt(N, df=2), 2));
2020 Mar 05
3
findInterval Documentation Suggestion
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 problem may be that we interact with the function via a compressed form of the bounds of the
2020 Mar 06
0
findInterval Documentation Suggestion
>>>>> brodie gaslam via R-devel >>>>> on Thu, 5 Mar 2020 22:18:33 +0000 (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 `?findInterval`, but > for whatever reason my
2004 Apr 16
7
Turning windows screen buffering on and off
All, Does anyone know if there is an option I can set to turn screen-buffered output on and off with the win32 rgui? (Apart from the point and click method). I am running some simulations where it is useful to watch output but it gets mildly tiresome having to manually switch things on and off via the gui. Thanks Toby. > version _ platform i386-pc-mingw32 arch
2013 Mar 14
0
funciones (findInterval, which) y simulación discreta
Tengo 2 grandes inquietudes: Necesito aplicar la función findInterval a una lista donde su componentes son matrices(32x32), cuyos intervalos se conformaron de la siguiente manera: 1er paso. # a todas las matrices se las dividió en matrices superiores e inferiores d_sup <- lapply(Matriz,function(x){data.matrix(upper.tri(x)*x)}) d_inf <-
2003 Aug 25
1
ODBC Oracle access
Hi all, I'm having trouble connecting to an oracle database using RODBC under winXP. Unfortunately I can't really send a reproducable error as the initial call to odbcConnect seems to hangs R and I have to kill the session. I have been using RODBC to sucessfully connect to an MS Access DB that has tables linked through to the oracle database in question and that seems to work OK but it
2011 Apr 04
2
General binary search?
Is there a generic binary search routine in a standard library which a) works for character vectors b) runs in O(log(N)) time? I'm aware of findInterval(x,vec), but it is restricted to numeric vectors. I'm also aware of various hashing solutions (e.g. new.env(hash=TRUE) and fastmatch), but I need the greatest-lower-bound match in my application. findInterval is also slow for
2002 Dec 13
2
xyplot {lattice} bug causes crash (PR#2370)
Full_Name: Toby Patterson Version: 1.6.0 OS: winXP Submission from: (NULL) (140.79.2.3) I seem to be able to cause a predictable crash (i.e. the application terminates abnormally) in R using the library lattice. If I have x<-cbind(1:10,c(rep(1,7),rep(2,3)),rnorm(10)) library(lattice) xyplot(x[,1]~x[,3]|x[,2]) # works oK but reversing the ylim entries i.e.
2018 Apr 20
1
create multiple categorical variables in a data frame using a loop
> On Apr 19, 2018, at 1:22 PM, David Winsemius <dwinsemius at comcast.net> wrote: > > >> On Apr 19, 2018, at 11:20 AM, Ding, Yuan Chun <ycding at coh.org> wrote: >> >> Hi All, >> >> I want to create a categorical variable, cat.pfoa, in the file of pfas.pheno (a data frame) based on log2pfoa values. I can do it using the following code.
2018 Apr 19
0
create multiple categorical variables in a data frame using a loop
> On Apr 19, 2018, at 11:20 AM, Ding, Yuan Chun <ycding at coh.org> wrote: > > Hi All, > > I want to create a categorical variable, cat.pfoa, in the file of pfas.pheno (a data frame) based on log2pfoa values. I can do it using the following code. > > pfas.pheno <-within(pfas.pheno, {cat.pfoa<-NA > cat.pfoa[pfas.pheno$log2pfoa
2003 Feb 03
2
plot.gam for glm objects.
All, I was wondering if someone had come across the problem of producing partial regression plots for glm objects in R? When using Splus in the past I have passed glm objects to the plot.gam function. To my knowledge this functionality isn't included in R ( I would be happily corrected here) and if someone had some code floating around to do this it would save me re-inventing wheels etc.
2004 Sep 14
2
R CMD SHLIB setup problem...
All, When I try and compile a shared library (on WinXP) I get the following error: E:\data\proj>R CMD SHLIB toy_dll.c Makevars:1: *** missing separator. Stop. Has someone else had this error and fixed it? This code compiles and works fine on Linux (fedora core 2). Everything was working fine under R1.8.1 but I've broken something when I upgraded to R1.9.1. So I am assuming
2011 Feb 27
4
[PATCH] Add minimal mkstemp(3) implementation.
This uses time, ASLR and pid for randomisation. (Closes: #516774) Signed-off-by: Thorsten Glaser <tg at mirbsd.org> --- usr/include/stdlib.h | 2 + usr/klibc/Kbuild | 2 +- usr/klibc/mkstemp.c | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 96 insertions(+), 1 deletions(-) create mode 100644 usr/klibc/mkstemp.c diff --git a/usr/include/stdlib.h
2009 Dec 10
0
Is there a variant of findInterval() such that v[i[j]] < x[j] <= v[i[j] + 1]?
In findInterval's help page, it says 'v[i[j]] <= x[j] < v[i[j] + 1]'. I'm wondering if there is a variant of it such that 'v[i[j]] < x[j] <= v[i[j] + 1]'.
2004 Aug 10
1
date axes and formats in levelplot
Hi all (and particularly Deepayan), A while back Deepayan helped me with the query in the text below (thanks again). Specifically it was about changing the way that dates plotted on the axes of lattice plots. While this works using xyplot, everything comes apart when I use levelplot. The axis labels on the date axis are shown as the integer representation of the date (number of seconds since