| To: | "Lambert.Winnie" <lambert.winnie@ensco.com>, "S-PLUS Newsgroup" <s-news@lists.biostat.wustl.edu> |
|---|---|
| Subject: | Re: 'Condition' statment |
| From: | Tony Plate <tplate@acm.org> |
| Date: | Fri, 09 Jan 2004 14:30:58 -0700 |
| In-reply-to: | <8986151694190742869D08450EE4DCDE2459DE@amu-exch.ensco.win> |
| Reply-to: | tplate@acm.org |
|
'if' is not intended to accept vectors in the condition. When given
a vector, it uses only the first element to decide whether to execute the
if or else block, and prints a warning to that effect: > if (c(F)) T else F [1] F > if (c(T)) T else F [1] T > if (c(T,T)) T else F Warning: Condition has 2 elements: only the first used: if(c(T, T)) T else F [1] T > if (c(T,F)) T else F Warning: Condition has 2 elements: only the first used: if(c(T, F)) T else F [1] T > if (c(F,T)) T else F Warning: Condition has 2 elements: only the first used: if(c(F, T)) T else F [1] F > hope this helps, Tony Plate At Friday 04:08 PM 1/9/2004 -0500, Lambert.Winnie wrote: All, |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: 'Condition' statment, Sundar Dorai-Raj |
|---|---|
| Next by Date: | Re: Nightingale roses, John Fox |
| Previous by Thread: | Re: 'Condition' statment, Sundar Dorai-Raj |
| Next by Thread: | IEEE/WIC/ACM IAT'04 (Call for Papers), wi-iat |
| Indexes: | [Date] [Thread] [Top] [All Lists] |