I am a beginner data science student in health sciences. I am attempting to clean my dataset before utilizing it for analysis.
I have beginner experience in R and need some assistance in converting a string to a numeric value so I can conduct analysis on the variable.
in the publicly available data, there is a character variable in which it asks people's perception on the health care system on a Likert scale but the way its coded in the dataset is "1 - terrible; 2; 3; 4;... 10 - Excellent"
All I want to do is:
1) Convert "1 - terrible" to just "1" and same with 10.
2) I would also like to omit all the "Don'tknow/refused" -- to remove this from my denominator.
I did some initial searching and I found some functions (strsplit) but I'm having difficulties applying it to my situation