Consider the vector:
x<-runif(30,20,100)
I would like to categorize this vector with the recode
function of the package dplyr
. The intervals can be arbitrary. For example:
- from 20 to 50 = 1
- from 51 to 75 = 2
- from 76 to 100 = 3
I know I can use other packages and functions to perform this action. But, my intention is specifically to do this with the function recode
of dplyr
. I have tried this in many ways, but so far I have not been successful.