Hi

also note the difference between if and ifelse. The former is similar 
to other languages

if (true or false codition) {do this} else {do that}

but

ifelse(logical vector, vector for true elements, vector for false 
elements)

see corespondent help pages.

HTH
Petr


On 18 Jan 2007 at 19:02, H. Paul Benton wrote:

Date sent:              Thu, 18 Jan 2007 19:02:49 -0800
From:                   "H. Paul Benton" <[EMAIL PROTECTED]>
To:                     [email protected]
Subject:                [R] if else statement

> Hello,
> 
>     I'm doing some scripting and I've noticed that R doesn't seem to
> have an if (cond){
>     do
> }ifelse (cond) {
>     do
> } else {
>     do
> }
> 
> type block.
> 
> Is this correct or am I missing something.
> 
> THX
> 
> Paul
> 
> -- 
> Research Technician
> Mass Spectrometry
>    o The
>   /
> o Scripps
>   \
>    o Research
>   /
> o Institute
> 
> ______________________________________________
> [email protected] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html and provide commented,
> minimal, self-contained, reproducible code.

Petr Pikal
[EMAIL PROTECTED]

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to