Re: [R] efficient code. how to reduce running time?

2007-01-22 Thread Charilaos Skiadas
On Jan 21, 2007, at 8:11 PM, John Fox wrote: Dear Haris, Using lapply() et al. may produce cleaner code, but it won't necessarily speed up a computation. For example: X - data.frame(matrix(rnorm(1000*1000), 1000, 1000)) y - rnorm(1000) mods - as.list(1:1000) system.time(for (i in

Re: [R] efficient code. how to reduce running time?

2007-01-22 Thread Prof Brian Ripley
On Mon, 22 Jan 2007, Charilaos Skiadas wrote: On Jan 21, 2007, at 8:11 PM, John Fox wrote: Dear Haris, Using lapply() et al. may produce cleaner code, but it won't necessarily speed up a computation. For example: X - data.frame(matrix(rnorm(1000*1000), 1000, 1000)) y - rnorm(1000)

Re: [R] efficient code. how to reduce running time?

2007-01-22 Thread John Fox
: [R] efficient code. how to reduce running time? On Jan 21, 2007, at 8:11 PM, John Fox wrote: Dear Haris, Using lapply() et al. may produce cleaner code, but it won't necessarily speed up a computation. For example: X - data.frame(matrix(rnorm(1000*1000), 1000, 1000)) y - rnorm

Re: [R] efficient code. how to reduce running time?

2007-01-22 Thread John Fox
Dear Brian, -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Prof Brian Ripley Sent: Monday, January 22, 2007 11:06 AM To: Charilaos Skiadas Cc: John Fox; r-help@stat.math.ethz.ch Subject: Re: [R] efficient code. how to reduce running time

Re: [R] efficient code. how to reduce running time?

2007-01-22 Thread Charilaos Skiadas
On Jan 22, 2007, at 10:39 AM, John Fox wrote: One thing that seems particularly striking in your results is the large difference between elapsed time and user CPU time, making me wonder what else was going on when you ran these examples. Yes, indeed there were a lot of other things

[R] efficient code. how to reduce running time?

2007-01-21 Thread miraceti
Hi, I am new to R. and even though I've made my code to run and do what it needs to . It is taking forever and I can't use it like this. I was wondering if you could help me find ways to fix the code to run faster. Here are my codes.. the data set is a bunch of 0s and 1s in a data.frame. What I am

Re: [R] efficient code. how to reduce running time?

2007-01-21 Thread miraceti
Here is the dataset you need to run this code.. http://mypage.iu.edu/~mirhan/msoutput.3932.100 thank you. On 1/21/07, miraceti [EMAIL PROTECTED] wrote: Hi, I am new to R. and even though I've made my code to run and do what it needs to . It is taking forever and I can't use it like this.

Re: [R] efficient code. how to reduce running time?

2007-01-21 Thread John Fox
-9140x23604 http://socserv.mcmaster.ca/jfox -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of miraceti Sent: Sunday, January 21, 2007 12:38 PM To: r-help@stat.math.ethz.ch Subject: [R] efficient code. how to reduce

Re: [R] efficient code. how to reduce running time?

2007-01-21 Thread miraceti
PROTECTED] On Behalf Of miraceti Sent: Sunday, January 21, 2007 12:38 PM To: r-help@stat.math.ethz.ch Subject: [R] efficient code. how to reduce running time? Hi, I am new to R. and even though I've made my code to run and do what it needs to . It is taking forever and I can't use

Re: [R] efficient code. how to reduce running time?

2007-01-21 Thread Charilaos Skiadas
On Jan 21, 2007, at 5:55 PM, miraceti wrote: Thank you all for lookin at it. I'll fix the code to preallocate the objects. and I wonder if there is a way to call anova on all the columns at the same time.. Right now I am calling (Y~V1, data) from V1 to V50 thru a loop. I tried (Y~.,

Re: [R] efficient code. how to reduce running time?

2007-01-21 Thread John Fox
@stat.math.ethz.ch Subject: Re: [R] efficient code. how to reduce running time? On Jan 21, 2007, at 5:55 PM, miraceti wrote: Thank you all for lookin at it. I'll fix the code to preallocate the objects. and I wonder if there is a way to call anova on all the columns at the same time