My data describes the rankings of preferred video game platform for 91 people. There are 6 consoles, so the df is 91x6, with each column being a console and the values being the ranking (1=most preferred, 6=least preferred).
Basically, the headers look like this:
xboxrank PSrank PSPrank PCrank Gameboyrank Gamecuberank
I need to create a column that just contains each person's favorite console (i.e. for each row, the column containing "1" indicated that the console represented by that column is the person's favorite). So, I need each person's favorite console, ideally as text (i.e. I'd have a variable "FavConsole" or something containing the actual names of each person's favorite console.
I'm pretty new to R and could figure this out in Stata, but for work purposes I need to do this in R.