When introduced to R, I learned how to use *apply whenever I could to avoid
for-loops and all. And, getting the habit, I think I somehow got the
mis-conception that it is a magic source, always an optimal way of coding in
R.
Thanks a lot for all of your helpful advice and comment!
Young
On Wed,
On Wed, Jan 5, 2011 at 10:49 PM, Young Cho young.s...@gmail.com wrote:
When introduced to R, I learned how to use *apply whenever I could to avoid
for-loops and all. And, getting the habit, I think I somehow got the
mis-conception that it is a magic source, always an optimal way of coding in
On 05.01.2011 22:49, Young Cho wrote:
When introduced to R, I learned how to use *apply whenever I could to avoid
for-loops and all. And, getting the habit, I think I somehow got the
mis-conception that it is a magic source, always an optimal way of coding in
R.
That is right, but your apply
Hi,
I am doing some simulations and found a bottle neck in my R script. I made
an example:
a = matrix(rnorm(500),100,5)
tt = Sys.time(); sum(a[,1]*a[,2]*a[,3]*a[,4]*a[,5]); Sys.time() - tt
[1] -1291.026
Time difference of 0.2354031 secs
tt = Sys.time(); sum(apply(a,1,prod));
On Jan 5, 2011, at 10:03 AM, Young Cho wrote:
Hi,
I am doing some simulations and found a bottle neck in my R script.
I made
an example:
a = matrix(rnorm(500),100,5)
tt = Sys.time(); sum(a[,1]*a[,2]*a[,3]*a[,4]*a[,5]); Sys.time() - tt
[1] -1291.026
Time difference of 0.2354031
On Wed, Jan 5, 2011 at 1:22 PM, David Winsemius dwinsem...@comcast.net wrote:
On Jan 5, 2011, at 10:03 AM, Young Cho wrote:
Hi,
I am doing some simulations and found a bottle neck in my R script. I made
an example:
a = matrix(rnorm(500),100,5)
tt = Sys.time();
On Jan 5, 2011, at 2:40 PM, Douglas Bates wrote:
On Wed, Jan 5, 2011 at 1:22 PM, David Winsemius dwinsem...@comcast.net
wrote:
On Jan 5, 2011, at 10:03 AM, Young Cho wrote:
Hi,
I am doing some simulations and found a bottle neck in my R
script. I made
an example:
a =
7 matches
Mail list logo