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
> -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
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))
quot;)
[1] "aa" "ao" "dcl" "iy" "sh"
>
Hope this helps
Best
Steven McKinney
-Original Message-
From: [EMAIL PROTECTED] on behalf of Min (Tilda) Zhang
Sent: Tue 11/27/2007 7:45 PM
To: r-help@r-project.org
Subject: [R] ifelse functi
Hi there,
I need help with IFELSE function.
The column g of my dataset pth, pth$g consists of "aa", "ao", "dcl", "iy",
"sh".
The last few values of pth$g looks like:
[4496] sh ao ao sh iy dcl dcl aa iy iy aa sh ao ao
Levels: aa ao dcl iy sh
I want to convert these values into 1,2,3,4
5 matches
Mail list logo