I have this dataframe with a column a. I would like to add a different column \'b\' based on column \'a\'.
For: if a>=10, b=\'double\'. Otherwise b=\'sing
You can use ifelse to act on vectors with if statements.
ifelse
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")