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)
>
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
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
3 matches
Mail list logo