r - if value in a df is between two number then add 1 code example
Example: r - if value in a df is between two number then add 1
library(TeachingDemos)
x <- c(3.2,6,7.8,1,3,2.5)
x <- ifelse(2 %<% x %<% 5, -1, x)
library(TeachingDemos)
x <- c(3.2,6,7.8,1,3,2.5)
x <- ifelse(2 %<% x %<% 5, -1, x)