This wine data set was collected from kaggle. It has a variable called quality that ranges between 1 to 8. I tried to categorize wine based on quality.
This is my code:
wineData$taste <- NA
wineData$taste[which(wineData$quality< 6)] <- bad
wineData$taste[which(wineData$quality>6)] <- excellent
wineData$taste[which(wineData$quality=6)] <- normal
wineData$taste <- factor(wineData$taste)
wineData`
This is the error I'm getting:
wineData$taste[which(wineData$quality>6)] <- excellent Error: object 'excellent' not found wineData$taste[which(wineData$quality==6)] <- normal Error: object 'normal' not found