My matrix consists of numbers:
set.seed(2016)
A <- matrix(rnorm(4,250,50), nrow = 2, ncol = 2, byrow = TRUE)
I want to discretize them into 3 classes: lmh <- c("low", "moderate", "high")
low: <30
medium: 30 - 300
high >300
Is this possible without converting the matrix into a data.frame
and without using a loop?
This seems like a very easy task but I could not find anything.