Maybe i dont have to use cut but i can not find any other method What i am trying to do is, on this table
y2018<- matrix(c(7.8,5,9,4,2.3,4,6),ncol=1,byrow=TRUE)
colnames(y2018) <- c("Numb")
i want to add a column so it will be like this
y2018$d_grade <- cut(y2018$Numb, c(-Inf,4.9,6.25,7.5,8.75,10), labels = c('Failed', 'Medium', 'Good', 'Very Good', 'Excellent'))
but I want to write failed where lower than 5 and then automatically cut the rest numbers, i dont want to write c(-Inf,4.9,6.25,7.5,8.75,10)
i dont know if its possible
something like this
y2018$d_grade <- cut(y2018$Numb, 5, labels = c('Failed', 'Medium', 'Good', 'Very Good', 'Excellent'))
Thanks Anyways