Some example code first:
Scores = c(5,4,3,2,1)
Breaks = c(0,0.6,0.8,1,1.2,100)
cut(1.19,breaks=Breaks, labels=Scores)
as.numeric(cut(1.19,breaks=Breaks,labels=Scores)
The first Output ist correctly 2, the second is wrong with 4. Why is there this difference? I actually need a numeric value, but the correct one...so how do I convert it correctly?
cut
returns a factor
and 2 is the 4th factor level. You need to convert factors to character first if you want the level labels as numerics:
as.numeric(as.character(cut(1.19,breaks=Breaks,labels=Scores)))
[1] 2