<body>
<div align="left"><font face="Times New Roman CE"><span style="font-size:12pt">Hi</span></font></div>
<div align="left"><br></div>
<div align="left"><font face="Times New Roman CE"><span style="font-size:12pt">On 30 Sep 2002 at 14:12, 
Katja Loytynoja wrote:</span></font></div>
<div align="left"><br></div>
<div align="left"><font face="Times New Roman CE" color="#7f0000"><span style="font-size:12pt">&gt; </span></font></div>
<div align="left"><font face="Times New Roman CE" color="#7f0000"><span style="font-size:12pt">&gt; 
Hello everyone,</span></font></div>
<div align="left"><font face="Times New Roman CE" color="#7f0000"><span style="font-size:12pt">&gt; </span></font></div>
<div align="left"><font face="Times New Roman CE" color="#7f0000"><span style="font-size:12pt">&gt; 
could anyone tell me how to get results from a loop as a vector. I've</span></font></div>
<div align="left"><font face="Times New Roman CE" color="#7f0000"><span style="font-size:12pt">&gt; 
tried</span></font></div>
<div align="left"><font face="Times New Roman CE" color="#7f0000"><span style="font-size:12pt">&gt; </span></font></div>
<div align="left"><font face="Times New Roman CE" color="#7f0000"><span style="font-size:12pt">&gt; 
&gt; d&lt;-3; nro&lt;-7; i&lt;-0</span></font></div>
<div align="left"><font face="Times New Roman CE" color="#7f0000"><span style="font-size:12pt">&gt; 
&gt; for(i in 1:d){ottonro&lt;-ottonro+const; print(ottonro)}</span></font></div>
<div align="left"><font face="Times New Roman CE" color="#7f0000"><span style="font-size:12pt">&gt; 
[1] 13</span></font></div>
<div align="left"><font face="Times New Roman CE" color="#7f0000"><span style="font-size:12pt">&gt; 
[1] 19</span></font></div>
<div align="left"><font face="Times New Roman CE" color="#7f0000"><span style="font-size:12pt">&gt; 
[1] 25</span></font></div>
<div align="left"><font face="Times New Roman CE" color="#7f0000"><span style="font-size:12pt">&gt; </span></font></div>
<div align="left"><font face="Times New Roman CE" color="#7f0000"><span style="font-size:12pt">&gt; 
and</span></font></div>
<div align="left"><font face="Times New Roman CE" color="#7f0000"><span style="font-size:12pt">&gt; </span></font></div>
<div align="left"><font face="Times New Roman CE" color="#7f0000"><span style="font-size:12pt">&gt; 
&gt; d&lt;-3; nro&lt;-7; i&lt;-0</span></font></div>
<div align="left"><font face="Times New Roman CE" color="#7f0000"><span style="font-size:12pt">&gt; 
&gt; for(i in 1:d){nro[i]&lt;-nro+const; print(nro)}</span></font></div>
<div align="left"><font face="Times New Roman CE" color="#7f0000"><span style="font-size:12pt">&gt; 
[1] 13</span></font></div>
<div align="left"><font face="Times New Roman CE" color="#7f0000"><span style="font-size:12pt">&gt; 
[1] 13 19</span></font></div>
<div align="left"><font face="Times New Roman CE" color="#7f0000"><span style="font-size:12pt">&gt; 
[1] 13 19 19</span></font></div>
<div align="left"><font face="Times New Roman CE" color="#7f0000"><span style="font-size:12pt">&gt; 
Warning message: </span></font></div>
<div align="left"><font face="Times New Roman CE" color="#7f0000"><span style="font-size:12pt">&gt; 
number of items to replace is not a multiple of replacement length </span></font></div>
<div align="left"><br>
</div>
<div align="left"><font face="Times New Roman CE"><span style="font-size:12pt">does something like this 
be OK?</span></font></div>
<div align="left"><br>
</div>
<div align="left"><font face="Times New Roman CE"><span style="font-size:12pt">start&lt;-13</span></font></div>
<div align="left"><font face="Times New Roman CE"><span style="font-size:12pt">const&lt;-6</span></font></div>
<div align="left"><font face="Times New Roman CE"><span style="font-size:12pt">opak&lt;-2</span></font></div>
<div align="left"><font face="Times New Roman CE"><span style="font-size:12pt">cumsum(c(start,rep(const,opak)))</span></font></div>
<div align="left"><font face="Times New Roman CE"><span style="font-size:12pt">[1] 13 19 25</span></font></div>
<div align="left"><br>
</div>
<div align="left"><font face="Times New Roman CE"><span style="font-size:12pt">or if you prefer loop</span></font></div>
<div align="left"><br>
</div>
<div align="left"><font face="Times New Roman CE"><span style="font-size:12pt">x&lt;-13</span></font></div>
<div align="left"><font face="Times New Roman CE"><span style="font-size:12pt">for (i in 1:2) x[i+1]&lt;-x[i]+6</span></font></div>
<div align="left"><font face="Times New Roman CE"><span style="font-size:12pt">x</span></font></div>
<div align="left"><font face="Times New Roman CE"><span style="font-size:12pt">[1] 13 19 25</span></font></div>
<div align="left"><br>
</div>
<div align="left"><font face="Times New Roman CE"><span style="font-size:12pt">(not sure what will be 
quicker:-)</span></font></div>
<div align="left"><br></div>
<div align="left"><font face="Times New Roman CE" color="#7f0000"><span style="font-size:12pt">&gt; </span></font></div>
<div align="left"><font face="Times New Roman CE" color="#7f0000"><span style="font-size:12pt">&gt; </span></font></div>
<div align="left"><font face="Times New Roman CE" color="#7f0000"><span style="font-size:12pt">&gt; 
but neither work. Any help would be much appreciated.</span></font></div>
<div align="left"><font face="Times New Roman CE" color="#7f0000"><span style="font-size:12pt">&gt; </span></font></div>
<div align="left"><font face="Times New Roman CE" color="#7f0000"><span style="font-size:12pt">&gt; 
regards,</span></font></div>
<div align="left"><font face="Times New Roman CE" color="#7f0000"><span style="font-size:12pt">&gt; 
Katja L&ouml;ytynoja</span></font></div>
<div align="left"><font face="Times New Roman CE" color="#7f0000"><span style="font-size:12pt">&gt; </span></font></div>
<div align="left"><font face="Times New Roman CE" color="#7f0000"><span style="font-size:12pt">&gt; </span></font></div>
<div align="left"><font face="Times New Roman CE" color="#7f0000"><span style="font-size:12pt">&gt; 
-------------------------------------------------------------------</span></font></div>
<div align="left"><font face="Times New Roman CE" color="#7f0000"><span style="font-size:12pt">&gt; 
Katja L&ouml;ytynoja, Taitoniekantie 9 D 505, 40 740 Jyv&auml;skyl&auml;, Finland &nbsp;&nbsp;&nbsp;</span></font></div>
<div align="left"><font face="Times New Roman CE" color="#7f0000"><span style="font-size:12pt">&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tel. +35850 336 0174, mail kaloytyn@jyu.fi</span></font></div>
<div align="left"><font face="Times New Roman CE" color="#7f0000"><span style="font-size:12pt">&gt; </span></font></div>
<div align="left"><font face="Times New Roman CE" color="#7f0000"><span style="font-size:12pt">&gt; </span></font></div>
<div align="left"><font face="Times New Roman CE" color="#7f0000"><span style="font-size:12pt">&gt; 
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.</span></font></div>
<div align="left"><font face="Times New Roman CE" color="#7f0000"><span style="font-size:12pt">&gt; 
-.-.-.-.- r-help mailing list -- Read</span></font></div>
<div align="left"><font face="Times New Roman CE" color="#7f0000"><span style="font-size:12pt">&gt; 
http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send &quot;info&quot;, &quot;help&quot;,</span></font></div>
<div align="left"><font face="Times New Roman CE" color="#7f0000"><span style="font-size:12pt">&gt; 
or &quot;[un]subscribe&quot; (in the &quot;body&quot;, not the subject !) &nbsp;To:</span></font></div>
<div align="left"><font face="Times New Roman CE" color="#7f0000"><span style="font-size:12pt">&gt; 
r-help-request@stat.math.ethz.ch</span></font></div>
<div align="left"><font face="Times New Roman CE" color="#7f0000"><span style="font-size:12pt">&gt; 
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.</span></font></div>
<div align="left"><font face="Times New Roman CE" color="#7f0000"><span style="font-size:12pt">&gt; 
_._._._._</span></font></div>
<div align="left"><br>
</div>
<div align="left"><font face="Times New Roman CE"><span style="font-size:12pt">Cheers</span></font></div>
<div align="left"><br>
</div>
<div align="left"><br></div>
<div align="left"><br>
</div>
<div align="left"><font face="Times New Roman CE"><span style="font-size:12pt">Petr Pikal</span></font></div>
<div align="left"><font face="Times New Roman CE"><span style="font-size:12pt">petr.pikal@precheza.cz</span></font></div>
<div align="left"><font face="Times New Roman CE"><span style="font-size:12pt">p.pik@volny.cz</span></font></div>
<div align="left"></div>
</body>

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._