Here\'s an excerpt of my dataframe:
x y se 4 a 7.146329 15 a 8.458633 17 a 9.286849 11 b 6
Could use ifelse here. Assuming data frame is named df1:
ifelse
df1
df1$x <- ifelse(df1$y %in% c("a", "b"), df1$x - 1, df1$x)