I have run into the following problem: due to a programming mistake, I had to change my rating scale from -4 to +4 to a scale from 0 to 9 temporarily. This results in 8 values in my data frame that I want to recode based on the ID that is defined in a different column.
id selfassessment
202 5
203 5
204 7
205 8
206 9
207 7
208 6
So for only those 8 rows in 'selfassessment' I want to change the values with 5 to 0, 6 to 1, 7 to 2, 8 to 3 and 9 to 4 without changing anything for the rest of the column. Can someone help me with this? Thank you!