[R] Loop stopping after 1 iteration

2011-05-18 Thread armstrwa
Hi all, This is a very basic question, but I just can't figure out why R is handling a loop I'm writing the way it is. Here is the script I have written: grid_2_series-function(gage_handle,data_type,filename) series_name-paste(gage_handle,data_type,sep=_)

Re: [R] Loop stopping after 1 iteration

2011-05-18 Thread Martyn Byng
16:18 To: r-help@r-project.org Subject: [R] Loop stopping after 1 iteration Hi all, This is a very basic question, but I just can't figure out why R is handling a loop I'm writing the way it is. Here is the script I have written: grid_2_series-function(gage_handle,data_type,filename

Re: [R] Loop stopping after 1 iteration

2011-05-18 Thread armstrwa
I knew it would be something simple. Thanks for catching that, Martyn. Billy -- View this message in context: http://r.789695.n4.nabble.com/Loop-stopping-after-1-iteration-tp3532988p3533041.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Loop stopping after 1 iteration

2011-05-18 Thread David Winsemius
On May 18, 2011, at 11:18 AM, armstrwa wrote: Hi all, This is a very basic question, but I just can't figure out why R is handling a loop I'm writing the way it is. Here is the script I have written: grid_2_series-function(gage_handle,data_type,filename)

Re: [R] Loop stopping after 1 iteration

2011-05-18 Thread Hugo Mildenberger
William, num_obs obviously isn't a vector, therefore length(num_obs) will evaluate to one. Hence your for loop control part will expand to for (i in 1:1) while it should probably read: for (i in 1:num_obs) Best Hugo On Wednesday 18 May 2011 17:18:15 armstrwa wrote: Hi

Re: [R] Loop stopping after 1 iteration

2011-05-18 Thread armstrwa
Didn't mean to snub you guys, Hugo and David. I didn't see your posts before. Thanks for the advice. -- View this message in context: http://r.789695.n4.nabble.com/Loop-stopping-after-1-iteration-tp3532988p3533217.html Sent from the R help mailing list archive at Nabble.com.