Skip to content
Prev 245094 / 398506 Next

Optimal method to scan cells and set flag

Hi

I am still working on my large dataset (sample attached) that contains a series of binary variables (flags, yes/no) regarding affected brain areas ("Lica","LAtChor","LA1" ,etc).

I need to scan these columns, if value = Y for "Lxxx" set "LesionSide" to "L", if Y for "Rxxx" set to "R" and "B" if both.  There are >2500 records, so for-loops would be inefficient. Any suggestions?

Much obliged.

Best

Jon

Soli Deo Gloria

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: test.txt
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20101216/a1ded1e6/attachment.txt>
-------------- next part --------------


Jon Erik Ween, MD, MS
Scientist, Kunin-Lunenfeld Applied Research Unit 
Director, Stroke Clinic, Brain Health Clinic, Baycrest Centre
Assistant Professor, Dept. of Medicine, Div. of Neurology
    University of Toronto Faculty of Medicine

Kimel Family Building, 6th Floor, Room 644 
Baycrest Centre
3560 Bathurst Street 
Toronto, Ontario M6A 2E1
Canada 

Phone: 416-785-2500 x3648
Fax: 416-785-2484
Email: jween at klaru-baycrest.on.ca


Confidential: This communication and any attachment(s) may contain confidential or privileged information and is intended solely for the address(es) or the entity representing the recipient(s). If you have received this information in error, you are hereby advised to destroy the document and any attachment(s), make no copies of same and inform the sender immediately of the error. Any unauthorized use or disclosure of this information is strictly prohibited.
On 2010-12-09, at 2:21 PM, David Winsemius wrote: