I have a dataset where I want to create a new column and add values based on the value present in each row. below is the example
Sales Result of new column 100 Low 200 Low 300 Moderate 400 High 500 High
Below is the code i tried to get result
data$New_Column = for (Sal in data$Sales){
if(Sal > 300){
print("High")
} else if(Sal == 300){
print("Moderate")
}else{
print("Low")
}
}
Thank You