Re: [R] for loop performance

2011-04-14 Thread Barth B. Riley
Thanks Martin, this is very helpful. Barth -Original Message- From: Martin Morgan [mailto:mtmor...@fhcrc.org] Sent: Thursday, April 14, 2011 11:04 AM To: Barth B. Riley Subject: Re: [R] for loop performance On 04/14/2011 07:12 AM, Barth B. Riley wrote: > Hi Martin > > Quest

Re: [R] for loop performance

2011-04-14 Thread Martin Morgan
On 04/13/2011 02:55 PM, Barth B. Riley wrote: Dear list I am running some simulations in R involving reading in several hundred datasets, performing some statistics and outputting those statistics to file. I have noticed that it seems that the time it takes to process of a dataset (or, say, a se

Re: [R] for loop performance

2011-04-14 Thread Philipp Pagel
On Thu, Apr 14, 2011 at 06:50:56AM -0500, Barth B. Riley wrote: > > Thank you Phillip for your post. I am reading in: > > 1. a 3 x 100 item parameter file (floating point and integer data) > 2. a 100 x 1000 item response file (integer data) > 3. a 6 x 1000 person parameter file (contains simulati

Re: [R] for loop performance

2011-04-14 Thread Barth B. Riley
Thank you Phillip for your post. I am reading in: 1. a 3 x 100 item parameter file (floating point and integer data) 2. a 100 x 1000 item response file (integer data) 3. a 6 x 1000 person parameter file (contains simulation condition information, person measures) 4. I am then computing several

Re: [R] for loop performance

2011-04-14 Thread Philipp Pagel
> I am running some simulations in R involving reading in several > hundred datasets, performing some statistics and outputting those > statistics to file. I have noticed that it seems that the time it > takes to process of a dataset (or, say, a set of 100 datasets) seems > to take longer as the si

[R] for loop performance

2011-04-13 Thread Barth B. Riley
Dear list I am running some simulations in R involving reading in several hundred datasets, performing some statistics and outputting those statistics to file. I have noticed that it seems that the time it takes to process of a dataset (or, say, a set of 100 datasets) seems to take longer as th

Re: [R] For Loop performance

2008-01-13 Thread mcoyne
Hi Uwe, Thank you so much for your help. It works great with your suggestion/help. WOW, what a difference! --MyC > > > [EMAIL PROTECTED] wrote: >> WRT: Say length(V1) is n, do you want to compare >>> v1[1] with v2[1] and v2[2] and v1[2] with v2[3] and v2[4] >>> or >>> v1[1] with v2[1] and v2[n

Re: [R] For Loop performance

2008-01-13 Thread Uwe Ligges
[EMAIL PROTECTED] wrote: > WRT: Say length(V1) is n, do you want to compare >> v1[1] with v2[1] and v2[2] and v1[2] with v2[3] and v2[4] >> or >> v1[1] with v2[1] and v2[n+1] and v1[2] with v2[2] and v2[n+2] > > v1[1] with (v2[1] and v2[2]) > v1[2] with (v2[3] and v2[4]) > v1[3] with (v2[5] and

Re: [R] For Loop performance

2008-01-13 Thread mcoyne
WRT: Say length(V1) is n, do you want to compare > v1[1] with v2[1] and v2[2] and v1[2] with v2[3] and v2[4] > or > v1[1] with v2[1] and v2[n+1] and v1[2] with v2[2] and v2[n+2] v1[1] with (v2[1] and v2[2]) v1[2] with (v2[3] and v2[4]) v1[3] with (v2[5] and v2[6]) ... v1[n] with (v2[n+1] an

Re: [R] For Loop performance

2008-01-13 Thread Uwe Ligges
My Coyne wrote: > Hello, > > > > Newbie question and hope you can help . > > I have two vector V1 and V2, where length(V2) = length of (V1) * 2; > length(V1) ~ 16,000. > > For each member in V1, I need to compare 2 element of V2 for equality If just the comparison is concerned, you can do

[R] For Loop performance

2008-01-13 Thread My Coyne
Hello, Newbie question and hope you can help . I have two vector V1 and V2, where length(V2) = length of (V1) * 2; length(V1) ~ 16,000. For each member in V1, I need to compare 2 element of V2 for equality i.e. for (I in 1:length (V1)) { if ( v2[i] == v1[i] & v2[i+1]==v1[i] ){