Hi all. I am struggling to figure how to action what I believe should be a pretty simple task.
I have a variable that is supposed to be a scale (numeric) measure. Members of the public have been asked to provide a rating between 0 and 10. The higher the score, the more satisfied they believe to be. However, there is additionally responses that are "don't know" and "refusal". I would like to simply change this variable so that it can be numeric between 0 and 10, which means removing the two character groups.
Below is a table of the variable in it's current form. Any helps would be appreciated as to how it can simply be turned into a numeric variable between 0 and 10.
Hi, as a beginner in R, I recommend studying about R's factor datatype, they will come up often, as in your case.
the tidyverse includes a great package called forcats for manipulating factors.
After you learned the basics from the above tutorial, it can be handy to refer back to this cheat sheet:
Thanks for recommending the books and will give the code a try. Ironically, I am also having a problem installing this tidyverse I have heard so much of! Every time I try and install it R Studio just crashes and I have to reboot. The joy!
Thanks again for the recommendations and the code.