I am new to R and
I have the following dataframe below with living_arrangements vertex on the y axis and loneliness_level vertex on the x axis.

What would be the best way if I wanted to to combine Alternate between parents and partner and College or student accomodation into its own unique category called other so I have my dataframe like the one below instead?
loneliness_level
living_arrangements 1 2 3 4 5 6 7 8 9 10
Alone 1 1 0 2 0 1 1 3 1 4
Other 1 2 5 2 2 1 2 3 1 0