Create categories by comparing a numeric column with a fixed value

Try

iris$Regulation <- ifelse(iris$Sepal.Length >=5, "UP", "DOWN")

Leave a Comment