thank you so much for helping! Now i got how to do it ;)
--
View this message in context:
http://r.789695.n4.nabble.com/Help-me-please-to-code-tp4646932p4647050.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mai
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
To: r-help@r-project.org
Cc:
Sent: Sunday, October 21, 2012 3:03 PM
Subject: [R] Help me please to code
User has to type (
Hello,
First of all, you should _really_ try to read An Introduction to R, file
R-intro.pdf that comes with every installation of R. The answer to your
question is in chapter 9 Grouping, loops and conditional execution.
It's the very first example:
"9.2.1 Conditional execution: if statements
3 matches
Mail list logo