瞅瞅是不是
https://blog.csdn.net/zhongkeyuanchongqing/article/details/120616332
使用ifelse语法
#if value in vector x is greater than 1, multiply it by 2
ifelse(x>1, x*2, x)
[1] 4 6 1 1 10 14
完整问题:
#define data
x <- c(2, 3, 1, 1, 5, 7)
#if value in vector x is greater than 1, multiply it by 2
if (x>1) {