Message-ID: <1350849956.77348.YahooMailNeo@web142606.mail.bf1.yahoo.com>
Date: 2012-10-21T20:05:56Z
From: arun
Subject: Help me please to code....
In-Reply-To: <1350846210584-4646932.post@n4.nabble.com>
HI,
Try this:
fun1<-function(X){
?Y<-ifelse(X==0,5/2,7)
?return(Y)}
?fun1(5)
#[1] 7
?fun1(0)
#[1] 2.5
?fun1(2)
#[1] 7
A.K.
----- Original Message -----
From: Rlotus <yerlan_ at hotmail.com>
To: r-help at r-project.org
Cc:
Sent: Sunday, October 21, 2012 3:03 PM
Subject: [R] Help me please to code....
User has to type (input) x.? After input....code has to check X with
statement if
There is a statement IF.
If X=0 then Y=5/2 else =7;
How to code it please. I tried but my code does not work ;( I wanna see how
it looks like( thank u in advance(
--
View this message in context: http://r.789695.n4.nabble.com/Help-me-please-to-code-tp4646932.html
Sent from the R help mailing list archive at Nabble.com.
______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.