I'm not sure we should measure superiority by how well a statement parses into English. If this were true, we would all be programming in COBOL.

Simon.


Simon Blomberg, BSc (Hons), PhD, MAppStat. 
Lecturer and Consultant Statistician 
School of Biological Sciences
The University of Queensland 
St. Lucia Queensland 4072 
Australia 
T: +61 7 3365 2506 
email: S.Blomberg1_at_uq.edu.au
http://www.uq.edu.au/~uqsblomb/

Policies:
1.  I will NOT analyse your data for you.
2.  Your deadline is your problem.

The combination of some data and an aching desire for 
an answer does not ensure that a reasonable answer can 
be extracted from a given body of data. - John Tukey.



-----Original Message-----
From: r-help-bounces@r-project.org on behalf of Dieter Menne
Sent: Tue 23/06/2009 4:43 PM
To: r-help@r-project.org
Subject: Re: [R] SAS-like method of recoding variables?
 



P.Dalgaard wrote:
> 
> 
>> IF TYPE='TRUCK' and count=12 THEN VEHICLES=TRUCK+((CAR+BIKE)/2.2);
> 
> vehicles <- ifelse(TYPE=='TRUCK' & count=12, TRUCK+((CAR+BIKE)/2.2), NA)
> 
> 

Read both versions to an audience, and you will have to admit that this is
one of the cases where SAS is superior.

Dieter


-- 
View this message in context: http://www.nabble.com/SAS-like-method-of-recoding-variables--tp24152845p24160742.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@r-project.org 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.


	[[alternative HTML version deleted]]


