Re: [R] apply if else statement to vector

2014-10-02 Thread Berend Hasselman
On 02-10-2014, at 11:01, r...@openmailbox.org wrote: > Subscribers, > > What is the correct syntax to apply the 'if else' conditional statement to > vector objects? > > Example: > > vectorx<-c(50,50,20,70) > vectory<-c(50,50,20,20) > vectorz<-function () { > if (vectorx>vectory) >

Re: [R] apply if else statement to vector

2014-10-02 Thread PIKAL Petr
ct.org] On Behalf Of r...@openmailbox.org > Sent: Thursday, October 02, 2014 11:02 AM > To: r-help@r-project.org > Subject: [R] apply if else statement to vector > > Subscribers, > > What is the correct syntax to apply the 'if else' conditional statement > to

[R] apply if else statement to vector

2014-10-02 Thread rl
Subscribers, What is the correct syntax to apply the 'if else' conditional statement to vector objects? Example: vectorx<-c(50,50,20,70) vectory<-c(50,50,20,20) vectorz<-function () { if (vectorx>vectory) vectorx else vectorx<-0 } vectorz() Warning message: In if (vec