money_edgelist <- read.csv("/Users/Dharma/SNA_Tutorial/money_edgelist.csv")
money_edgelist
A data.frame: 11 × 2
Ego Alter
Greg Maria
Greg Mark
Greg Lexi
Greg Grace
Greg Nick
Maria Mark
Maria Lexi
Maria Grace
Maria Nick
Mark Nick
Lexi Nick
attributes <- read.csv("/Users/Dharma/SNA_Tutorial/Hoffman_family.csv", stringsAsFactors = F)
attributes
A data.frame: 6 × 4|Name|Age|Gender|Role|
| Name| Age | Gender| Relation
| || ||
|Greg |53 |Male| Father|
|Maria |25 |Male |Mother|
|Mark |23 |Male| Son|
|Lexi| 23 |Female|Daughter|
|Grace|19|Female|Daughter|
|Nick| 14| Male| Son|
moneyNetwork <- graph_from_data_frame(money_edgelist, directed = T, vertices = attributes)
Error in graph_from_data_frame(money_edgelist, directed = T, vertices = attributes): Some vertex names in edge list are not listed in vertex data frame
Traceback:
- graph_from_data_frame(money_edgelist, directed = T, vertices = attributes)
- stop("Some vertex names in edge list are not listed in vertex data frame")
Please advise correct coding
SHRINIVAS