[R] for loop

Steve Lianoglou mailinglist.honeypot at gmail.com
Wed Aug 5 20:52:29 CEST 2009


On Aug 5, 2009, at 2:36 PM, waltzmiester wrote:

> Um I still followed the guidelines...

Focus on trying to ask a better question rather than going down this  
route ...

Honestly, your original question is rather vague and leaves us to  
guess (i) what you're trying to do, and (ii) how to help.

For example:


for(k in col){

Models(GLM=T, GAM=T, RF=T, GBM=T, TSS=T, KeepPredIndependent=T)

Your for loop is correct and should iterate 6 times, and k is getting  
vals 23 to 28:

You say that this code stops after the first model is complete, but if  
all goes well, it really shouldn't, eg:

for(k in col) {
cat(k, ' ')

23  24  25  26  27  28  >

This means R should be giving you some type of error message and w/o  
telling us more, we're left to take stabs at the dark, which isn't a  
goof use of anybody's time.

Steve Lianoglou
Graduate Student: Computational Systems Biology
   |  Memorial Sloan-Kettering Cancer Center
   |  Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact

More information about the R-help mailing list