search for: rbenchmark

Displaying 20 results from an estimated 47 matches for "rbenchmark".

Did you mean: benchmark
2015 Jan 22
5
Programming Tools CTV
...I'm about to check in a new version of the task view that includes packrat and checkpoint, as they seem closer to reproducible research, but also feel like coding tools. There are a few other packages that many would find useful for better coding: devtools, testthat, lintr, codetools, svTools, rbenchmark, pkgutils, etc. This might be some overlap with the HPC task view. I would think that rJava, Rcpp and the like are better suited there but this is arguable. The last time I proposed something like this, Martin deftly convinced me to be the maintainer. It is probably better for everyone if we avoi...
2012 Nov 22
1
Data Extraction - benchmark()
...ates.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252 [4] LC_NUMERIC=C LC_TIME=English_United States.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] rbenchmark_1.0.0 loaded via a namespace (and not attached): [1] tools_2.15.1 I would appreciate receiving your help if your time permits .. Thanks and regards, Pradip Muhuri ##### Berend's code extended N <- 100000 set.seed(13) df<-data.frame(matrix(sample(c(1:10,NA),N, replace=TRUE),ncol=5...
2018 Jan 04
3
silent recycling in logical indexing
...recycling. Doesn't TRUE replicate from length-1 to length-3 in this case (mat[c(TRUE,FALSE),2] would be an example of incomplete recycling)? William: clever, but maybe too clever unless you really need the speed? (The clever way is 8 times faster in the following case ...) x <- rep(1,1e6) rbenchmark::benchmark(x[c(FALSE,TRUE,FALSE)],x[seq_along(x) %% 3 == 2]) On the other hand, it takes 0.025 vs 0.003 seconds per iteration ... fortunes::fortune("7ms") On Thu, Jan 4, 2018 at 4:09 PM, Berry, Charles <ccberry at ucsd.edu> wrote: > > >> On Jan 4, 2018, at 11:56 AM, B...
2009 Jun 04
3
Fast way of finding top-n values of a long vector
If x is a (long) vector and n << length(x), what is a fast way of finding the top-n values of x? Some suggestions (calculating the ratio of the two top values): library("rbenchmark") set.seed(1); x <- runif(1e6, max=1e7); x[1] <- NA; benchmark( replications=20, columns=c("test","elapsed"), order="elapsed" , sort = {a<-sort(x, decreasing=TRUE, na.last=NA)[1:2]; a[1]/a[2];} , max = {m<-max(x, na.rm=TRUE); w<-which(x==m)[1]...
2010 Sep 09
0
Fast / dependable way to "stack together" data frames from a list
...ces, this would all work faster. mylist2 <- lapply(mylist, as.matrix) matrixDoCall <- do.call("rbind", mylist2) all.equal(as.data.frame(matrixDoCall), resultDF) ## Gabor also showed a better way than 'system.time' to find out how ## long this takes on average using the rbenchmark package. Awesome! #> library(rbenchmark) #> benchmark( #+ df = do.call("rbind", mylist), #+ mat = do.call("rbind", L), #+ order = "relative", replications = 250 #+ ) ## To see the potentially HUGE impact of these changes, we need to ## make a bigger test case...
2012 Jun 24
1
Indexing matrices from the Matrix package with [i, j] seems to be very slow. Are there "faster alternatives"?
Dear all, Indexing matrices from the Matrix package with [i,j] seems to be very slow. For example: library(rbenchmark) library(Matrix) mm <- matrix(c(1,0,0,0,0,0,0,0), nr=20, nc=20) MM <- as(mm, "Matrix") lookup <- function(mat){ for (i in 1:nrow(mat)){ for (j in 1:ncol(mat)){ mat[i,j] } } } benchmark(lookup(mm), lookup(MM), columns=c("test", "repli...
2010 Sep 19
2
get time as a number
Hi, all, How to get a time as a number? While script is running, I want to print the elapsed time something like TIME_AS_SECOND() in the following script inittime <- TIME_AS_SECOND() for (i in 1:100){ do_something(i) curtime <- TIME_AS_SECOND() elapsedtime <- curtime-inittime print(paste(i, elapsedtime)) } Thanks in advance, Hyunchul [[alternative HTML version
2009 Sep 26
3
Adding variables
Hi, For very large matrices, is this the most efficient way to add two variables together? ############################# attach(attenu) new<-rowSums(cbind(mag, station)) ############################# Also, could I be directed to some resources for working with very large datasets? Thanks
2015 Sep 17
1
Optimize R: some confusion with Lapack and OpenBlas/openBlas openmp packages.
...to optimize my R package. At first, I installed parallel_studio_xe_2016 with a free one year licence. Then, I build a package for R with Intel MKL and compiler. This took me lots of time as it was my first .rmp build. I finally managed to build and run it. Now, when looking at some blogs about R-RBenchmark.25, I realized that there is very few speed difference between Intel BLAS and OpenBlas. I am now wondering if such Intel stuff (with its paid licencing) and the need to build my own R package is really worth. Do anyone have some realistic point of view/advice? Then, in case I gave up with the Int...
2015 Jan 22
2
Programming Tools CTV
...he task view that includes packrat and >> checkpoint, as they seem closer to reproducible research, but also >> feel like coding tools. >> >> There are a few other packages that many would find useful for better >> coding: devtools, testthat, lintr, codetools, svTools, rbenchmark, >> pkgutils, etc. >> >> This might be some overlap with the HPC task view. I would think that >> rJava, Rcpp and the like are better suited there but this is arguable. >> >> The last time I proposed something like this, Martin deftly convinced >> me to be...
2009 Apr 22
5
large factorials
I am working on a project that requires me to do very large factorial evaluations. On R the built in factorial function and the one I created both are not able to do factorials over 170. The first gives an error and mine return Inf. Is there a way to have R do these larger calculations (the calculator in accessories can do 10000 factorial and Maple can do even larger) -- View this message in
2011 Jan 21
1
match function causing bad performance when using table function on factors with multibyte characters on Windows
...ce to dicuss it.] Running ?table? on a factor with levels containing non-ASCII characters seems to result in extremely bad performance on Windows. Here?s a simple example with benchmark results (I?ve reduced the number of replications to make the function finish within reasonable time): library(rbenchmark) x.num=sample(1:2, 10^5, replace=TRUE) x.fac.ascii=factor(x.num, levels=1:2, labels=c("A","B")) x.fac.nascii=factor(x.num, levels=1:2, labels=c("?","?")) benchmark( table(x.num), table(x.fac.ascii), table(x.fac.nascii), table(unclass(x.fac.nascii)), r...
2017 Jun 14
2
[WISH / PATCH] possibility to split string literals across multiple lines
...example: atestfun <- function(x){ y <- paste0("a very long", "string for testing") grep(x, y) } atestfun2 <- function(x){ y <- "a very long string for testing" grep(x,y) } cfun <- cmpfun(atestfun) cfun2 <- cmpfun(atestfun2) require(rbenchmark) benchmark(atestfun("a"), atestfun2("a"), cfun("a"), cfun2("a"), replications = 100000) Which gives after 100,000 replications: test replications elapsed relative 1 atestfun("a") 100000...
2015 Jan 22
1
Programming Tools CTV
...gt;>>> checkpoint, as they seem closer to reproducible research, but also >>>> feel like coding tools. >>>> >>>> There are a few other packages that many would find useful for better >>>> coding: devtools, testthat, lintr, codetools, svTools, rbenchmark, >>>> pkgutils, etc. >>>> >>>> This might be some overlap with the HPC task view. I would think that >>>> rJava, Rcpp and the like are better suited there but this is arguable. >>>> >>>> The last time I proposed something like...
2015 Jan 22
0
Programming Tools CTV
...a new version of the task view that includes packrat and > checkpoint, as they seem closer to reproducible research, but also > feel like coding tools. > > There are a few other packages that many would find useful for better > coding: devtools, testthat, lintr, codetools, svTools, rbenchmark, > pkgutils, etc. > > This might be some overlap with the HPC task view. I would think that > rJava, Rcpp and the like are better suited there but this is arguable. > > The last time I proposed something like this, Martin deftly convinced > me to be the maintainer. It is prob...
2015 Jan 22
0
Programming Tools CTV
...n a new version of the task view that includes packrat and > checkpoint, as they seem closer to reproducible research, but also > feel like coding tools. > > There are a few other packages that many would find useful for better > coding: devtools, testthat, lintr, codetools, svTools, rbenchmark, > pkgutils, etc. > > This might be some overlap with the HPC task view. I would think that > rJava, Rcpp and the like are better suited there but this is arguable. > > The last time I proposed something like this, Martin deftly convinced > me to be the maintainer. It is probab...
2009 Jun 19
1
Alternate ways of finding number of occurrence of an element in a vector.
Hi, I have a vector "v" and would like to find the number of occurrence of element "x" in the same. Is there a way other than, sum(as.integer(v==x)) or length(which(x==v)) to do the this. I have a huge file to process and do this. Both the above described methods are pretty slow while dealing with a large vector. Please have your comments. Praveen
2010 Sep 01
1
Where can the "benchmark2" function be downloaded from?
Hello all, I am looking for the function benchmark2 ( a nice function for comparing the performance of two or more functions). I found online it exists in the butler package http://crantastic.org/packages/butler But for some reason, that package was removed from CRAN: http://cran.r-project.org/web/packages/butler/ It can still be downloaded from the archive, but I am wondering if it had moved
2009 Feb 28
2
Rprofiling
Dear R People: Could someone recommend a good reference for Rprofing, please? Thanks, Erin -- Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston - Downtown mailto: erinm.hodgess at gmail.com
2010 May 12
2
how to profile R interpreter?
Hi, all. Does anyone know how to profile R interpreter? I've tried gprof but it doesn't work. Thanks. Xiaoming [[alternative HTML version deleted]]