I'm new to R and need some help.
I have two separate binary categorical variables: mild heart disease and severe heart disease (0 is no, 1 is yes). I need to merge this into one variable called heart disease with 3 levels: none, mild, severe.
| Mild heart disease | Severe heart disease |
|---|---|
| 0 | 0 |
| 0 | 0 |
| 0 | 1 |
| 0 | 0 |
| 0 | 0 |
| 1 | 0 |
| 0 | 0 |
I want to have a variable that combines this into all heart disease (either in categorical form or in numerical as 0,1,2)
| heart disease |
|---|
| none |
| none |
| severe |
| none |
| none |
| mild |
| none |
How can I go about this. Thanks a lot