I want to restructure some "multiple response" survey data from binary to nominal categories.

The survey asks the responder which ten people they most often interact with and gives a list of 50 names. The data comes back with 50 columns, one column for each name, and a name value in each cell for each name selected and blank for unselected names. I want to convert the fifty columns into ten columns (name1 to name10).

Below is an example of what I mean with (for simplicity) 5 names, where the person must select two names with five responders.

```r
id <- 1:5
mike <- c("","mike","","","mike")
tim <- c("tim","","tim","","")
mary <- c("mary","mary","mary","","")
jane <- c("","","","jane","jane")
liz <- c("","","","liz","")

surveyData <- data.frame(id,mike,tim,mary,jane,liz)

Name1 <- c("tim","mike","tim","jane","mike")
Name2 <- c("mary","mary","mary","liz","jane")

restructuredSurveyData <- data.frame(id,Name1,Name2)

```