I have a numeric vector that I want to convert to five numeric levels. I can get the five levels using cut
dx <- data.frame(x=1:100)
dx$cut <- cut(dx$x,5)
But I am now having problems extracting the lower and upper boundaries of the levels.
So for example
(0.901,20.8] would be 0.901 in dx$min and 20.8 in dx$max.
I tried:
dx$min <- pmin(dx$cut)
dx$max <- pmax(dx$cut)
dx
But this does not work.