I'm trying to generate two new variables based on the values of an extant variable. It's a very simple operation but I can't seem to get it to function correctly and on all values of a vector in r. I'm trying to convert to r from SPSS but this particular goal does not seem to translate very well into r.I'm trying to generate two new variables based