Hi, I want to rate the feedback from user of options given below as 1 - 4. Can someone help?

 Feedback Good OK Can be Better Very Bad Rating 1 2 3 4 Jun 27, 2019 1,305 views

## 2 answers to this question.

Hi Ravi,

You can change the levels in a factor by using factor() and mention explicitly the order of levels in a vector.

Use statement like below,

```feedback = c("Good","OK","Can be Better","Very Bad")

order = factor(feedback, levels = c("Good","OK","Can be Better", "Very Bad"))

print(order)``` Hope it helps! answered Jun 27, 2019 by
• 33,010 points

You can also use relevel() to change the level in a factor.

relevel() takes the factor and the level element and push it to front in the level.

write as below -

```feedback = c("Good","OK","Can be Better","Very Bad")
rating = factor(feedback)
print(rating)
print(as.integer(rating))
rating = relevel(rating,"Can be Better")
rating = relevel(rating,"OK")
rating = relevel(rating,"Good")
print(rating)
print(as.integer(rating))```  answered Jun 27, 2019 by sindhu

## Change the order of legend values in a plot in R

@prardhana, Use scale_fill/color/size_discrete/contin....(labels = c()). compare both to see ...READ MORE

## Changing the order of bars in a bar-plot - ggplot2 - R

You can use the scale_x_discrete() function with ...READ MORE

+1 vote

## Is it possible to change the column names of the dataset that I'm using in R?

That is definitely possible in R. You ...READ MORE

## By using dpylr package sum of multiple columns

Basically here we are making an equation ...READ MORE

## How to convert a text mining termDocumentMatrix into excel or csv in R?

By assuming that all the values are ...READ MORE

## In a dpylr pipline how to use sample and seq?

For avoiding rowwise(), I prefer to use ...READ MORE

## How to create a list of Data frames?

Basically all we have to do is ...READ MORE

+1 vote