If one had a group of data and if they wanted to take a variable in that data frame and group them into categories and then add those categories as variables on the existing data frame by using an if function, how would one go about doing so?
Cause I'm thinking i write the if function, specify the requirements and then enter the function to add that to the data frame in the curly brackets, but the I don't know how I would apply that to all the data in the variable.