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
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
+ }
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
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
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