Re: [R] nested for loop

2007-07-18 Thread jim holtman
This should create your files for you: x <- 1:1080 # test data # create a vector of 30 consecutive values for spliting the data breaks <- rep(1:ceiling(length(x) / 30), each=30)[1:length(x)] # now partition the data into 30 values and write them fileNo <- 1 # initialize the file number invisible

[R] nested for loop

2007-07-18 Thread Sherri Heck
Hi, I am new to programming and R. I am reading the manual and R books by Dalgaard and Veranzo to help answer my questions but I am unable to figure out the following: I have a data file that contains 1080 data points. Here's a snippet of the file: [241] 0.3603704000 0.1640741000 0.291296

Re: [R] Nested for loop

2006-12-04 Thread Peter Dalgaard
Natalie Zayats wrote: > Hi all, > > Does anybody know whether one can nest IF statement in multiple FOR loops ? > According to results of my code, only the first iteration of each loop is > performed... > > Well, yes, that should be possible. Proving your claim with actual sample code would giv

Re: [R] Nested for loop

2006-12-04 Thread Simon Blomberg
Please supply some code that reproduces the problem! cheers, Simon. Natalie Zayats wrote: > Hi all, > > Does anybody know whether one can nest IF statement in multiple FOR loops ? > According to results of my code, only the first iteration of each loop is > performed... > > Thanks, > > Regards,

[R] Nested for loop

2006-12-04 Thread Natalie Zayats
Hi all, Does anybody know whether one can nest IF statement in multiple FOR loops ? According to results of my code, only the first iteration of each loop is performed... Thanks, Regards, Natalie [[alternative HTML version deleted]] __ R-hel

Re: [R] nested for loop restriction?

2006-06-20 Thread Petr Pikal
ote: Date sent: Tue, 20 Jun 2006 14:20:50 +0200 From: René Capell <[EMAIL PROTECTED]> To: r-help@stat.math.ethz.ch Organization: http://freemail.web.de/ Subject: [R] nested for loop restriction? > Hello, >

[R] nested for loop restriction?

2006-06-20 Thread René Capell
Hello, is there a restriction for the number of loops in a nested for-loop in R? I wrote a small function to replace water gage hights by discharge values, where the outer loop walks through the levels of a gage time series and the inner loop looks up the corresponding dicharge value in a vector