In R, type the line that adds a level column to orders — "High" where amount is at least 500, otherwise "Low".
In R, type the line that adds a level column to orders — "High" where amount is at least 500, otherwise "Low".
Answer
orderslevel <- ifelse(ordersamount >= 500, "High", "Low")
Condition, value if TRUE, value if FALSE — all twelve rows in one call. table(orders$level) is High 5, Low 7; the column is character, not factor.