mardi 21 février 2017

If a value then return another value in a new column in R

I have a data set that has several columns. One of the columns is called "group" and has values like: 1124,1251,2615,3541. I want to insert a new column that looks at the value in a row in "group" and returns a category name. So, 1124 would return "Test" and 1251 would return "Coffee."

I'm a newby to R, so any help you could give would be really helpful.

Aucun commentaire:

Enregistrer un commentaire