I have a matrix that is approximately 430 X 20,000. Each row is a person, each column is a project they have worked on. Each cell has a value of either 0 - (not involved), 1 - (project head, only one per project), 2 - (project helper). I am trying to look at only the projects that a single person was the head of. I only want to look at one person at a time. So for Person A I need r to drop all columns where that person's value isn't 1. But I want to retain all the data about other individuals in those columns.
Ex:
Name Project 1 Project 2......Project 2,000
Person A 1 0 2
Person B 0 1 1
Person C 2 2 2
I am trying to get something for Person B that drops columns they didn't head.
Name Project 2...... Project 2,000
Person A 0 2
Person B 1 1
Person C 2 2
Sorry if this is obvious, for some reason I have really struggled to find examples for data this large (a.k.a I can't just type in the column names because there are too many). Any help would be greatly appreciated.