Re: [R] IFELSE function XXXX

2011-04-05 Thread Ben Bolker
William Dunlap tibco.com> writes: > Avoid assignments in arguments to function calls, especially > multiple assignments to the same object, except when you know > what you are doing and want to write obscure code. > > Change the above line to > data3$input1 <- ifelse(data3$res1==1, data3$input

Re: [R] IFELSE function XXXX

2011-04-05 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Dan Abner > Sent: Tuesday, April 05, 2011 12:58 PM > To: r-help@r-project.org > Subject: [R] IFELSE function > > Hello everyone, > > Th

[R] IFELSE function XXXX

2011-04-05 Thread Dan Abner
Hello everyone, This IFELSE function call is not working properly. I do not receive an error message, but the actions are not executed conditional as I was hoping. Any assistance is appreciated. set.seed(12345) res1<-rbinom(1,1,.1) rdata3<-transform(data.frame(res1),input1=rnorm(1,50,10))