[R] if else elseif for data frames

R. Michael Weylandt michael.weylandt at gmail.com
Mon Aug 13 04:51:40 CEST 2012


On Sun, Aug 12, 2012 at 8:07 PM, Sachinthaka Abeywardana
<sachin.abeywardana at gmail.com> wrote:
> The thing is I have about 10 cases. I saw the ifelse statement

Note that there is no "ifelse" statement: there is only nested if/else of forms

if

else if

         else if

                   else ....


> but was
> wondering if there was a cleaner method of doing it. The coding will get
> really messy when I write all 10 cases.
>
> Cheers,
> Sachin
>

Possibly look at ?switch

Michael



More information about the R-help mailing list