[R] for loops?

Petr Pikal petr.pikal at precheza.cz
Mon Feb 2 16:19:15 CET 2004


Hi

On 2 Feb 2004 at 8:42, Catherine Stein wrote:

> 
> Hello R people!
> 
> How can one use a for loop (or something similar) in R?  As I type in
> each line, I get syntax errors... I'm just confused how much to type

Use curly braces
for (i in ...) {

your long commands
in several lines

}

"An Introduction to R" in doc directory is your best friend.

Cheers
Petr

> in at each ">" prompt.
> 
> Thanks for your help,
> cathy
> 
> 
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ~~~~~~~~~ Catherine M. Stein Research Assistant, Tuberculosis Research
> Unit Doctoral Candidate in Genetic Epidemiology Department of
> Epidemiology and Biostatistics Case Western Reserve University office:
> (216)368-0875 or (216)778-1378 e-mail: kasia at darwin.cwru.edu, or
> cmstein at cwru.edu http://darwin.cwru.edu/~kasia
> 
> EPBI Student Resources Page:
> http://hal.epbi.cwru.edu/stures/
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ~~~~~~
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html

Petr Pikal
petr.pikal at precheza.cz




More information about the R-help mailing list