I am quite new to R and I am having some troubles with creating factors. I should create a factor from a numeric variable. This factor should have three levels: dissatisfied (v
I would probably just use cut
:
> x <- 0:10
> cut(x = x,breaks = c(0,4,5,10),include.lowest = TRUE,
labels = c('Dissatisfied','Either/Or','Satisfied'))
[1] Dissatisfied Dissatisfied Dissatisfied Dissatisfied Dissatisfied Either/Or Satisfied Satisfied
[9] Satisfied Satisfied Satisfied
Levels: Dissatisfied Either/Or Satisfied