You can use ifelse
to act on vectors with if statements.
ifelse(a>=10, "double", "single")
So your code could look like this
mydata <- cbind(a, ifelse(a>10, "double", "single"))
(Specified in comments below that if a=10, then "double")
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…