I am trying to categorize FICO scores in three categories and want to create a new column where the corresponding value can be displayed.
My data:
FICO
650
450
700
Expected output
FICO Category
650 Moderate
450 Poor
700 Excellent
I wrote an if statement for this
model_data$ficocategory <- if (model_data$FICO>=350 &&
model_data$FICO<=500) {
print("POOR")
} else if (model_data$FICO>=501 && model_data$FICO<=650) {
print("MODERATE")
} else
print("EXCELLENT")
But the output I get is
[1] "MODERATE"