similar to: Question on Rprof(); was: Re: sapply and loop

Displaying 20 results from an estimated 1000 matches similar to: "Question on Rprof(); was: Re: sapply and loop"

2004 Oct 16
7
sapply and loop
Dear all, I am doing 200 times simulation. For each time, I generate a matrix and define some function on this matrix to get a 6 dimension vector as my results. As the loop should be slow, I generate 200 matrice first, and save them into a list named ma, then I define zz<-sapply(ma, myfunction) To my surprise, It almost costs me the same time to get my results if I directly use a loop
2004 Oct 16
7
sapply and loop
Dear all, I am doing 200 times simulation. For each time, I generate a matrix and define some function on this matrix to get a 6 dimension vector as my results. As the loop should be slow, I generate 200 matrice first, and save them into a list named ma, then I define zz<-sapply(ma, myfunction) To my surprise, It almost costs me the same time to get my results if I directly use a loop
2004 Sep 30
1
Vectorising and loop (was Re: optim "a log-likelihood function")
>From: Sundar Dorai-Raj <sundar.dorai-raj at PDF.COM> >Reply-To: sundar.dorai-raj at PDF.COM >To: Zhen Pang <nusbj at hotmail.com> >CC: r-help at stat.math.ethz.ch >Subject: Vectorising and loop (was Re: [R] optim "a log-likelihood >function") >Date: Wed, 29 Sep 2004 18:21:17 -0700 > > > >Zhen Pang wrote: > >> >>I also use
2010 Sep 23
0
R CMD Rprof --help suggestion
Hi, >From reading ?Rprof, I checked R CMD Rprof --help and learned that there are options to specify the min % to print. This is currently (R-devel r52975) displayed with the --help option as --min%total minimum % to print for 'by total' --min%self minimum % to print for 'by self' So I tried R CMD Rprof --min%total 5 and got an error. After looking at
2007 Mar 31
1
Probem with argument "append" in "Rprof"
Hello, Appending information to the profiler's output seems to generate problems. Here is a small example of code : <code r> require(boot) Rprof( memory.profiling = TRUE) Rprof(NULL) for(i in 1:2){ Rprof( memory.profiling = TRUE, append = TRUE) example(boot) Rprof(NULL) } </code> The problem is that the file Rprof.out contains more than once the header information: $ grep
2003 Oct 21
5
run R under linux
Dear all, Our department uses the linux system and we are not allowed to submit job directly. We must make a batch to submit through "qmon". so, I make a foo.sh file, which only contains one line: nohup R --vanilla < foo.txt > foo.results foo is all my codes. It is a simulation of 200 times. I set the seed at the beginning. It is to estimate the success probability, which is
2002 Jun 08
3
contour plot for non-linear models
Hello all, I've tried to reproduce the contour plot that appears in the book of Venables and Ripley, at page 255. Is a F-statistic surface and a confidence region for the regression parameters of a non-linear model. It uses the stormer data that are in the MASS package. I haven't been able to reproduce the plot either in R ( version 1.5 ) and S. It makes the axes and it puts the
2009 Jun 12
1
Rprof loses all system() time
Rprof seems to ignore all time spent inside system() calls. E.g., this simple example actually takes about 10 seconds, but Rprof thinks the total time is only 0.12 seconds: > Rprof("sleep-system.out") ; system.time(system(command="sleep 10")) ; Rprof(NULL) user system elapsed 0.000 0.004 10.015 > summaryRprof("sleep-system.out")$by.total
2005 Jan 20
0
Interpreting Rprof output
Hello! I have run Rprof on a function of mine and the results look very strange, to say the least. At the end I of this email is an output of summaryRprof. Can someone help me interpret this output? I have read the appropriate section in the manual "Writing R Extensions" and help pages. If I understand this output correctly, it is saying that "unlist" has been active in
2011 Feb 11
1
Help optimizing EMD::extrema()
Hi folks, I'm attempting to use the EMD package to analyze some neuroimaging data (timeseries with 64 channels sampled across 1 million time points within each of 20 people). I found that processing a single channel of data using EMD::emd() took about 8 hours. Exploration using Rprof() suggested that most of the compute time was spent in EMD::extrema(). Looking at the code for EMD:extrema(),
2013 Apr 24
0
help with execution of 'embarrassingly parallel' problem using foreach, doParallel on a windows system
Dear R helpers, I have what another member on this forum described as an embarrassingly parallel problem. I am trying to fit models on subsets of some data based on unique combinations of two id factors in the dataset. Total number of combinations is 30^5, and this takes a long time. So, I would like fit models for each of the datasets produced by subsetting on the unique combinations, splitting
2011 Feb 28
0
Fwd: Re: speed up process
Dear Jim, Here is again exactly what I did and with the output of Rprof (with this reduced dataset and with a simpler function, it is here much faster than in real life). Thanks you again for your help! ## CODE ## mydata1<- structure(list(species = structure(1:8, .Label = c("alsen","gogor", "loalb", "mafas", "pacyn", "patro",
2017 May 18
1
Interpreting R memory profiling statistics from Rprof() and gc()
Sorry, this might be a really basic question, but I'm trying to interpret the results from memory profiling, and I have a few questions (marked by *Q#*). From the summaryRprof() documentation, it seems that the four columns of statistics that are reported when setting memory.profiling=TRUE are - vector memory in small blocks on the R heap - vector memory in large blocks (from malloc) - memory
2003 Oct 10
3
command line limit under unix?
Dear all, I have made my testing program to run successfully under unix in the background. However, my simulation work does not work. I read the foo.results file, I found it only have part of my code and not any output I want. Is there any line limit? My code is nearly 400 line. I can cut some of them, but I want to know whether there is any limit or exactly the number of limit is. Thanks.
2010 Nov 19
1
memory profiling
I'm trying to configure Version 2.12.0 or R to do memory profiling. I've reconfigured the code: % ./compile --enable-memory-profiling=YES and verified that it's configured correctly by examining the output. I then rebuild R: % make Then I fire up R and run a script, using Rprof with the memory-profiling switch set to TRUE: Rprof("output", memory.profiling=TRUE); # a
2004 Sep 12
0
write.table performance: an alternative?
Dear R's, I have been using R lately to perform some statistical analysis and, based on them, simulations to be exported in flat text files to other programs. These text files are nowadays of about 30MB in size, but they could finally be of up to 300MB. Writing these files with either write.table or write.matrix was desperately slow and the bottleneck of the whole process. Besides, the
2010 Jan 05
1
Naming functions for the purpose of profiling
Hi all, I have some long-running code that I'm trying to profile. I am seeing a lot of time spent inside the <Anonymous> function. Of course, this can in fact be any of several functions, but I am unable to see how I could use the information from Rprof.out to discern which function is taking the most time. An example line from my Rprof.out is: rbernoulli <Anonymous>
2007 Aug 23
2
read big text file into R
Dear Rs: Hi, I am trying to read a big text file (nrows=243440, ncols=144). It seems the computational time of all the read methods (scan,readtable,read.delim) is not linear to the number of rows I want to read in: things became really slow once I tried to read in 100000 lines compare to 10000 lines). If I am reading the profiling result right, I guess scan wouldn't help either. My
2009 Mar 03
1
profiler and loops
Hello, (This is follow up from this thread: http://www.nabble.com/execution-time-of-.packages-td22304833.html but with a different focus) I am often confused by the result of the profiler, when a loop is involved. Consider these two scripts: script1: Rprof( ) x <- numeric( ) for( i in 1:10000){ x <- c( x, rnorm(10) ) } Rprof( NULL ) print( summaryRprof( ) ) script2:
2007 Oct 22
2
Help interpreting output of Rprof
Hello there, I am not quite sure how to interpret the output of Rprof (in the following the output I was staring at). I was poking around the web a little bit for documentation but without much success. I guess if I want to figure out what takes so long in my code the 2nd table $by.total and the total.pct column (pct = percent) is the most helpful. What does it mean that [ or [.data.frame is