代码如下,系统始终对if后面的条件句报错,请问怎么办
a3$a28 <- if((a3$x1 > a3$x2)==FALSE){
-1
}else{
a3$x1+3
}
错误为:In if ((a3$x1 > a3$x2) == FALSE) { :
the condition has length > 1 and only the first element will be used
数据如图所示,我想让x1中为-1的在a28中依然为-1,x1中那些大于-1的值在a28中加3。
x1和x2的类型均为numeric,长度均相等。