similar to: sapply and loop

Displaying 20 results from an estimated 3000 matches similar to: "sapply and loop"

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
2004 Oct 19
0
Question on Rprof(); was: Re: sapply and loop
Yes. It should have something to do with read/write permissions, but it is not clear how it happens. I can write file to C drive using R. I usually write my results matrix to a txt file in C drive. For Rprof(), the boot.out file can be created, but only with one line sample.interval=20000 The situation is the same even if I specify the directory to the D drive,where I have the full
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
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
2013 Mar 05
2
Function completely locks up my computer if the input is too big
Dear r-help, Somewhere in my innocuous function to rotate an object in Cartesian space I've created a monster that completely locks up my computer (requires a hard reset every time). I don't know if this is useful description to anyone - the mouse still responds, but not the keyboard and not windows explorer. The script only does this when the input matrix is large, and so my initial
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.
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
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(),
2009 Nov 10
1
standardGeneric seems slow; any way to get around it?
Hi, I'm running some routines with standard matrix operations like solve() and diag(). When I do a profile, the lead item under total time is standardGeneric(). Furthermore, solve() and diag() have much greater total time than self time. ??? I assume there is some time-consuming decision going on in the usual functions; is there any way to avoid that and go straight to the calculaions? Thanks
2004 Jul 16
3
interpreting profiling output
I have some trouble interpreting the output from profiling. I have read the help pages Rprof, summaryRprof and consult the R extensions manual, but I still have problems understanding the output. Basically the output consist of self.time and total.time. I have the understanding that total.time is the time spent in a given function including any subcalls or child functions or whatever 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
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
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
2013 Apr 05
2
line profiling
Hello, This is about the new "line profiling" feature in R 3.0.0. As I was testing it, I find the results somewhat disappointing so I'd like to get your opinion. I put some poorly written code in a test.R file, here are the contents: double <- function(x) { out <- c() for (i in x) { out <- c(out, 2*i) # line 4 } return(out) } Then this how I source the file
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:
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
2003 Dec 19
1
iterative proportional fitting
Dear all, I wonder if there are some function or package in R which can do the iterative proportional fitting. In the exponential model f(y1,...yn)=exp(a'yi+b'(yi*yj)+.....+c'(y1*...*yn)+constance), instead of the canonical parameters, I use maginal probability instead of a and log odds ratio instead of b. and for the order higher than 3, I use the canonical way or even assume
2013 Oct 24
2
Rarezas con boot
Hola. Algo raro me pasa con la librería boot y con lme4. En una misma máquina, core i5. Un bootstrap R=500 utilizando los 4 hilos de procesamiento tarda 1 hora con xubuntu 12.04 y R 2.14 y 3 con xubuntu 13.10 y R 3.0.1 Alguna idea de que puede estar pasando?? [[alternative HTML version deleted]]
2009 Oct 19
2
how to get rid of 2 for-loops and optimize runtime
Short: get rid of the loops I use and optimize runtime Dear all, I want to calculate for each row the amount of the month ago. I use a matrix with 2100 rows and 22 colums (which is still a very small matrix. nrows of other matrixes can easily be more then 100000) Table before Year month quarter yearmonth Service ... Amount 2009 9 Q3 092009 A ...