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))
-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,
This IFELSE function call is not working
William Dunlap wdunlap at 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,
3 matches
Mail list logo