[R] assigning dataframes in an ifelse statement
peter dalgaard
pdalgd at gmail.com
Mon Mar 17 08:49:07 CET 2014
On 17 Mar 2014, at 06:20 , Jeff Newmiller <jdnewmil at dcn.davis.ca.us> wrote:
> Solution is to not use ifelse. Use if...else...
Specifically,
A <- if (x==2) B else C
(Newcomers may not immediately catch on to the fact that flow control statements in R are function calls with syntactic sugar, and that they return a value.)
-pd
--
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com
More information about the R-help
mailing list