'Correlation node attribute edge type
I'm trying to find out correlation between node attributes and edge type. I only manage to compute a correlation matrix between node attributes, but my expected output would be a correlation matrix between node attributes and edge type using
nodes %>% correlate() %>% fashion()
Can I use this function for correlating node attributes and edge type?
Example data:
nodes <- structure(list(Age = c(96L, 45L, 34L, 42L, 43L, 22L, 29L, 24L,
37L, 36L, 30L, 29L, 30L, 44L, 41L, 38L, 41L, 31L, 44L, 45L, 39L,
36L, 46L, 53L, 32L, 34L, 41L, 34L, 47L, 50L, 39L), Gender = c(2,
3, 2, 3, 2, 2, 2, 2, 1, 1, 2, 1, 1, 2, 3, 3, 2, 1, 2, 3, 2, 3,
2, 1, 2, 2, 3, 2, 2, 2, 1), Main.activity = c(2, 2, 2, 1, 2,
2, 2, 2, 2, 1, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2,
2, 2, 1, 2, 2), Groups = c(3, 5, 6, 5, 6, 6, 6, 6, 5, 4, 4, 5,
6, 5, 1, 6, 2, 6, 5, 6, 2, 6, 2, 4, 1, 5, 6, 2, 1, 2, 5), Religions = c(2,
3, 2, 3, 2, 2, 2, 2, 1, 1, 2, 1, 1, 2, 3, 3, 2, 1, 2, 3, 2, 3,
2, 1, 2, 2, 3, 2, 2, 2, 1), Elder = c(1, 6, 2, 7, 6, 2, 2, 2,
5, 5, 6, 4, 5, 5, 6, 6, 4, 3, 2, 4, 4, 6, 2, 6, 4, 4, 6, 6, 3,
3, 4)), row.names = c("BePil01", "Be0101", "Be0102", "Be0103",
"Be0104", "Be0105", "Be0106", "Be0107", "BePil02", "Be0201",
"Be0202", "Be0203", "Be0204", "Be0205", "Be0206", "Be0207", "BePil03",
"Be0301", "Be0302", "Be0303", "Be0304", "Be0305", "Be030201",
"BePil04", "Be0401", "Be0402", "Be0403", "Be0404", "Be0405",
"Be0406", "Be0407"), class = "data.frame")
links <- structure(list(Source = c("BePil01", "BePil01", "BePil01", "BePil01",
"BePil02", "BePil02", "BePil02", "BePil02", "BePil02", "BePil02",
"BePil02", "BePil03", "BePil03", "BePil03", "BePil03", "BePil03",
"Be0302", "BePil04", "BePil04", "BePil04", "BePil04", "BePil04"
), Target = c("Be0102", "Be0104", "Be0105", "Be0106", "Be0201",
"Be0202", "Be0203", "Be0204", "Be0205", "Be0206", "Be0207", "Be0301",
"Be0302", "Be0303", "Be0304", "Be0305", "Be030201", "Be0403",
"Be0404", "Be0405", "Be0406", "Be0407"), Type = c("Directed",
"Directed", "Directed", "Directed", "Directed", "Directed", "Directed",
"Directed", "Directed", "Directed", "Directed", "Directed", "Directed",
"Directed", "Directed", "Directed", "Directed", "Directed", "Directed",
"Directed", "Directed", "Directed"), Weight = c(1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L), Learning.type = c(4, 2, 4, 1, 4, 4, 2, 2, 1, 2, 4, 4,
4, 4, 2, 4, 3, 2, 5, 2, 4, 2)), row.names = c(NA, -22L), class = "data.frame")
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
