How to group or classify values in a column in R.
The target variable loan_status has a few values as can be seen in the picture.
I would like to classify loans with the following loan_status values as being in default (bad, or 1):
- Charged Off
- Late (31–120 days)
- Does not meet the creditpolicy. Status:Charged Off
All the other values will be classified as good (or 0).
How to do it in R?