I am trying to pull data from Excel in the form:
| Survey Respondents | Abby | Brandon | Jane | Mary | Pat |
|---|---|---|---|---|---|
| Jane | 1 | 0 | 0 | 1 | 0 |
| Pat | 0 | 0 | 1 | 1 | 0 |
Where 1 represents that the survey respondent knows the person in the column and zero represents that the survey respondent does not know the person in the column.
And I want to create two matrices that would have the form (where the numbers represent people)
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | 0 | 0 | 1 | 0 | 0 |
| 2 | 0 | 0 | 0 | 0 | 0 |
| 3 | 1 | 0 | 0 | 1 | 0 |
| 4 | 0 | 0 | 1 | 0 | 1 |
| 5 | 0 | 0 | 1 | 1 | 0 |
And
| ID | NAME |
|---|---|
| 1 | Abby |
| 2 | Brandon |
| 3 | Jane |
| 4 | Mary |
| 5 | Pat |
I've done this in Matlab, but since the network analysis is done in R, I'd rather do it all in R.
I am brand new to R, so I tried to do this by creating a new matrix from the starting matrix but was having trouble with matrix dimensions. And was unsure how to include the 0 and 1 data in addition to just creating the row and column labels.
