[Rd] Assigning NULL to large variables is much faster than rm() - any reason why I should still use rm()?

2013-05-25 Thread Henrik Bengtsson
Hi, in my packages/functions/code I tend to remove large temporary variables as soon as possible, e.g. large intermediate vectors used in iterations. I sometimes also have the habit of doing this to make it explicit in the source code when a temporary object is no longer needed. However, I did n

Re: [Rd] Assigning NULL to large variables is much faster than rm() - any reason why I should still use rm()?

2013-05-25 Thread William Dunlap
Another way to avoid using rm() in loops is to use throw-away functions. E.g., > t3 <- system.time(for (k in 1:ncol(x)) { # your last, fastest, example + a <- x[,k] + colSum <- sum(a) + a <- NULL # Not needed anymore + b <- x[k,] + rowSum <- sum(b) + b <- NULL # Not needed anymore + }

[Rd] R in the browser ...

2013-05-25 Thread Jony Hudson
Hi all, I hope you'll forgive me - I don't plan to start using this list as my blog - but given the discussion following my last post I thought people on here might be interested to see some progress. This is a minimal build of R, cross-compiled from C/Fortran to javascript with emscripten - t

Re: [Rd] Assigning NULL to large variables is much faster than rm() - any reason why I should still use rm()?

2013-05-25 Thread Simon Urbanek
On May 25, 2013, at 3:48 PM, Henrik Bengtsson wrote: > Hi, > > in my packages/functions/code I tend to remove large temporary > variables as soon as possible, e.g. large intermediate vectors used in > iterations. I sometimes also have the habit of doing this to make it > explicit in the source c

Re: [Rd] Assigning NULL to large variables is much faster than rm() - any reason why I should still use rm()?

2013-05-25 Thread Henrik Bengtsson
On Sat, May 25, 2013 at 4:38 PM, Simon Urbanek wrote: > On May 25, 2013, at 3:48 PM, Henrik Bengtsson wrote: > >> Hi, >> >> in my packages/functions/code I tend to remove large temporary >> variables as soon as possible, e.g. large intermediate vectors used in >> iterations. I sometimes also have