similar to: Proposed speedup of ifelse

Displaying 20 results from an estimated 2000 matches similar to: "Proposed speedup of ifelse"

2018 May 08
1
Proposed speedup of ifelse
Hugh, (Note I speak for myself only and not for R-core) Thanks for looking into this. I think it's great to have community members that are interested in contributing to R and helping it continue to get better. And I think, and my local experiments bear out, that using anyNA as a fastpass condition does allow us to get a significant speedup over what's in there now. To do so, though, I
2018 May 04
0
Proposed speedup of ifelse
Thanks Radford. I concur with all your points. I've attempted to address the issues you raised through the github.io post. The new method appears to be slower for test lengths < 100 and possibly longer lengths (not just < 10). Of course length(test) < 100 is very quick, so I simply added this to the conditions that cause the old ifelse method to be invoked. I'll leave it to
2018 May 03
1
Proposed speedup of ifelse
I propose a patch to ifelse that leverages anyNA(test) to achieve an improvement in performance. For a test vector of length 10, the change nearly halves the time taken and for a test of length 1 million, there is a tenfold increase in speed. Even for small vectors, the distributions of timings between the old and the proposed ifelse do not intersect. The patch does not intend to change the
2003 Aug 13
1
stars graphs
Hi listers, A few days ago I posted a question about the use of the stars function on selected lines of a frame. Thanks to two helpers, a closer look at the scale argument allowed to partially solve the problem. Yet I still have a problem with stars. Allow me to explain what I intend to do (sorry for my poor English and the long post): I want to graph an activity index of a fish during the day
2010 Oct 18
1
make error for R 2.13.0 (and 2.12.0)
Regarding Tengfei Yin's post about an error trying to install "cluster" in 2.13.0, I have gotten an error with this package when trying to install the released version of 2.12.0. Here is the output on an Ubuntu Linux system: begin installing recommended package cluster * installing *source* package 'cluster' ... ** libs make[3]: Entering directory
2015 Jun 13
2
Lack of protection bug in current R release candidate
The current R release candidate has a lack of protect bug (of very long standing) with respect to the R_print.na_string and R_print.na_string_noquote fields of the static R_print structure declared in Print.h. This shows up very occassionally as incorrect output from the following lines in reg-tests-2.R: x <- c("a", NA, "b") factor(x) factor(x, exclude="")
2019 May 01
3
anyNA() performance on vectors of POSIXct
Inside of the anyNA() function, it will use the legacy any(is.na()) code if x is an OBJECT(). If x is a vector of POSIXct, it will be an OBJECT(), but it is also TYPEOF(x) == REALSXP. Therefore, it will skip the faster ITERATE_BY_REGION, which is typically 5x faster in my testing. Is the OBJECT() condition really necessary, or could it be moved after the switch() for the individual TYPEOF(x)
2015 Aug 21
2
OpenMP problem with 64-bit Rtools
I've been getting pqR to work on windows systems, and in the process have discovered various problems with R core versions of R and with Rtools. One is with the implementation of OpenMP in 64-bit Rtools. This problem is in Rtools215 and Rtools33, and presumably all the ones in between. You can see the problem with the following test program: #include <stdio.h> #include <omp.h>
2009 May 25
3
Interpolating variables within (RODBC library) SQL statements for MySQL
Hi everyone, I am desperately looking for a method to interpolate strings within an SQL statement as follows: I get a lot of rows out of a database (in my example POSITION_to_ZIPCODE Database with holds records for German ZIP Code <--> Gauss-Krueger Coordinate System ) and want this to be selected and computed individually row by row as follows: library(RODBC) channel <-
2015 Jun 15
1
Lack of protection bug in current R release candidate
> > The current R release candidate has a lack of protect bug > > (of very long standing) > > [ but not really reported, right ? ] It's "long standing" because it exists in versions of R going back many years. > but the R 3.2.1 release candidate probably really cannot be > touched now, with something non-trivial like this. > > We'd be
2011 Jan 01
3
Plot symbols: How to plot (and save) a graphic symbols originating from a table
Dear all, Please, I have a doubt regarding symbol plotting with data originating from a table. Please, see below: I have a tab delimited file called table1.txt with 4 columns: ypos animal var1 var2 5 cat gina <= lady gina \u2264 lady 7 dog bill >= tony bill \u2265 tony 9 fish dude <= bro dude \u2264 bro #I then load in the data to R: table1<-read.table("table1.txt",
2015 Jul 14
3
Two bugs showing up mostly on SPARC systems
In testing pqR on Solaris SPARC systems, I have found two bugs that are also present in recent R Core versions. You can see the bugs and fixes at the following URLs: https://github.com/radfordneal/pqR/commit/739a4960a4d8f3a3b20cfc311518369576689f37 https://github.com/radfordneal/pqR/commit/339b7286c7b43dcc6b00e51515772f1d7dce7858 The first bug, in nls, is most likely to occur on a 64-bit
2016 Sep 09
3
R (development) changes in arith, logic, relop with (0-extent) arrays
> Radford Nea: > > So it may make more sense to move towards consistency in the > > permissive direction, rather than the restrictive direction. > > > That would mean allowing matrix(1,1,1) < (1:2), and maybe also things > > like matrix(1,2,2)+(1:8). > > Martin Maechler: > That is an interesting idea. Yes, in my view that would >
2011 Jul 25
2
Best practices for writing R functions (really copying)
Gabriel Becker writes: AFAIK R does not automatically copy function arguments. R actually tries very hard to avoid copying while maintaining "pass by value" functionality. ... R only copies data when you modify an object, not when you simply pass it to a function. This is a bit misleading. R tries to avoid copying by maintaining a count of how many references there are to an
2015 Jun 17
1
Add-on argument in sample()
> Then the question would be if this test could be replaced with a new > argument to sample, e.g. expandSingle, which has TRUE as default for > backward compatibility, but FALSE if you dont want population to be > expanded to 1:population. It could certainly be useful in some cases, > but you still need to know about the expansion to use it. I think most > of these bugs
2014 Sep 26
3
Patch to add buffering to decoding too
Can you please wrap the setvbuf in _WIN32 IFDEFs too? Currently memory usage of FLAC decoding is about 1MB, so this patch is increasing memory usage tenfold, also for platforms that do not need this. It is a non-problem on my system anyway. Op 26-09-14 om 10:36 schreef Janne Hyv?rinen: > I made some changes to the previous patch. I don't know why I > originally didn't put the
2017 Jun 16
4
[WISH / PATCH] possibility to split string literals across multiple lines
> On Wed, 14 Jun 2017, G?bor Cs?rdi wrote: > > > I like the idea of string literals, but the C/C++ way clearly does not > > work. The Python/Julia way might, i.e.: > > > > """this is a > > multi-line > > lineral""" > > luke-tierney at uiowa.edu: > This does look like a promising option; some more careful checking
2015 Feb 18
3
Recycling memory with a small free list
> ... with assignments inside of loops like this: > > reweight = function(iter, w, Q) { > for (i in 1:iter) { > wT = w * Q > } > } > ... before the RHS is executed, the LHS allocation would be added > to a small fixed length list of available space which is checked > before future allocations. If the same size is requested before the > next garbage
2007 Aug 13
3
hasNA() / anyNA()?
Hi, is there a hasNA() / an anyNA() function in R? Of course, hasNA <- function(x) { any(is.na(x)); } would do, but that would scan all elements in 'x' and then do the test. I'm looking for a more efficient implementation that returns TRUE at the first NA, e.g. hasNA <- function(x) { for (kk in seq(along=x)) { if (is.na(x[kk])) return(TRUE); } FALSE; }
2016 Sep 12
1
R (development) changes in arith, logic, relop with (0-extent) arrays
> > But isn't the intent to make it an error later? So I assume we're > > debating making it an error, not just a warning. > > Yes, that's correct. > But if we have a longish deprecation period (i.e. where there's > only a warning) all important code should have been adapted > before it turns to an error That might be true for