as a newbie in R, I got stuck to this issue of data manipulation: I need to create a factor with 4 levels from to two numerical vectors (enable, restrict). The latter are factor scores.
The 4 levels should be:
level 1 = data$enable > median(data$enable) & data$restrict > median(data$restrict)
level 2 = data$enable < median (data$enable) & data$restrict > median (data$restrict)
and the following two more combinations. I want to label the levels as well. I am not sure how to nest it in the factor() function.
Any help? Thank you