Re: [R] a better method than a long expression with many OR clauses

2013-12-17 Thread Steve Lianoglou
Hi Chris, (extra compelled to answer a Q from my undergrad alma mater :-) see below: On Tue, Dec 17, 2013 at 11:13 AM, Christopher W Ryan cr...@binghamton.edu wrote: dd - data.frame(longVariableName1=sample(1:4, 10, replace=TRUE), longVariableName2=sample(1:4, 10, replace=TRUE)) dd # define

[R] a better method than a long expression with many OR clauses

2013-12-17 Thread Christopher W Ryan
dd - data.frame(longVariableName1=sample(1:4, 10, replace=TRUE), longVariableName2=sample(1:4, 10, replace=TRUE)) dd # define who is a case and who is not transform(dd, case=(longVariableName1==3 | longVariableName2==3)) But in reality I have 9 of those longVariableName variables, all of this