This network models the people around my role as a Financial Management Analyst, organized by team affiliation rather than strict reporting hierarchy. Each person belongs to a team (e.g., Financial Analyst Team vs. Financial Leadership) and each edge is tagged as either a same-team connection or a cross-team connection. For example, my supervisor and I are connected, but we sit on different sides of the financial org — I’m on the analyst side, she’s on the leadership side — so that tie is cross-team even though it’s a close, frequent one. Names are replaced with role titles for privacy.
library(tidyverse)
library(igraph)
library(kableExtra)
library(scales)
vertices <- tibble(
id = c("Me", "Supervisor", "Director", "PeerA", "PeerB",
"BranchHeadB", "AnalystC", "BudgetOfficer", "Mentor", "ContractSpec"),
role = c(
"Financial Mgmt Analyst (GS-11)",
"Branch Head",
"Comptroller / Director",
"Financial Mgmt Analyst",
"Financial Mgmt Analyst",
"Branch Head (Accounting)",
"Financial Mgmt Analyst",
"Budget Officer",
"Senior Analyst (Mentor)",
"Contracting Specialist"
),
team = c(
"Financial Analyst Team", "Financial Leadership", "Financial Leadership",
"Financial Analyst Team", "Financial Analyst Team", "Accounting Team",
"Accounting Team", "Budget Team", "Financial Analyst Team", "Contracts Team"
),
level = c(
"Analyst", "Leadership", "Leadership", "Analyst", "Analyst",
"Leadership", "Analyst", "Analyst", "Analyst (Senior)", "Analyst"
)
)
vertices %>%
kable(caption = "Employees in the network, by team and level") %>%
kable_styling(latex_options = "striped")
| id | role | team | level |
|---|---|---|---|
| Me | Financial Mgmt Analyst (GS-11) | Financial Analyst Team | Analyst |
| Supervisor | Branch Head | Financial Leadership | Leadership |
| Director | Comptroller / Director | Financial Leadership | Leadership |
| PeerA | Financial Mgmt Analyst | Financial Analyst Team | Analyst |
| PeerB | Financial Mgmt Analyst | Financial Analyst Team | Analyst |
| BranchHeadB | Branch Head (Accounting) | Accounting Team | Leadership |
| AnalystC | Financial Mgmt Analyst | Accounting Team | Analyst |
| BudgetOfficer | Budget Officer | Budget Team | Analyst |
| Mentor | Senior Analyst (Mentor) | Financial Analyst Team | Analyst (Senior) |
| ContractSpec | Contracting Specialist | Contracts Team | Analyst |
edges <- tibble(
from = c("Me", "PeerA", "PeerB", "Supervisor", "BranchHeadB", "AnalystC",
"Me", "Me", "PeerA", "Mentor"),
to = c("Supervisor", "Supervisor", "Supervisor", "Director", "Director",
"BranchHeadB", "BudgetOfficer", "Mentor", "ContractSpec", "Supervisor"),
hierarchy = c("reports_to", "reports_to", "reports_to", "reports_to",
"reports_to", "reports_to", "collaborates_with",
"collaborates_with", "collaborates_with", "collaborates_with")
) %>%
left_join(vertices %>% select(id, team), by = c("from" = "id")) %>%
left_join(vertices %>% select(id, team), by = c("to" = "id"), suffix = c("_from", "_to")) %>%
mutate(connection_type = if_else(team_from == team_to, "same_team", "cross_team")) %>%
select(from, to, hierarchy, connection_type)
edges %>%
kable(caption = "Relationships (edges): hierarchy + team connection type") %>%
kable_styling(latex_options = "striped")
| from | to | hierarchy | connection_type |
|---|---|---|---|
| Me | Supervisor | reports_to | cross_team |
| PeerA | Supervisor | reports_to | cross_team |
| PeerB | Supervisor | reports_to | cross_team |
| Supervisor | Director | reports_to | same_team |
| BranchHeadB | Director | reports_to | cross_team |
| AnalystC | BranchHeadB | reports_to | same_team |
| Me | BudgetOfficer | collaborates_with | cross_team |
| Me | Mentor | collaborates_with | same_team |
| PeerA | ContractSpec | collaborates_with | cross_team |
| Mentor | Supervisor | collaborates_with | cross_team |
org_graph <- graph_from_data_frame(
d = edges,
vertices = vertices,
directed = TRUE
)
org_graph
## IGRAPH c4bd43b DN-- 10 10 --
## + attr: name (v/c), role (v/c), team (v/c), level (v/c), hierarchy
## | (e/c), connection_type (e/c)
## + edges from c4bd43b (vertex names):
## [1] Me ->Supervisor PeerA ->Supervisor
## [3] PeerB ->Supervisor Supervisor ->Director
## [5] BranchHeadB->Director AnalystC ->BranchHeadB
## [7] Me ->BudgetOfficer Me ->Mentor
## [9] PeerA ->ContractSpec Mentor ->Supervisor
Same-team edges are drawn solid; cross-team edges are dashed, so the “bridges” between teams stand out visually rather than the reporting hierarchy.
E(org_graph)$lty <- ifelse(E(org_graph)$connection_type == "same_team", 1, 2)
E(org_graph)$color <- ifelse(E(org_graph)$connection_type == "same_team", "grey30", "firebrick")
V(org_graph)$color <- scales::col_factor(
"Set2", domain = NULL
)(V(org_graph)$team)
plot(
org_graph,
layout = layout_with_fr(org_graph),
vertex.size = 28,
vertex.label.cex = 0.75,
vertex.label.color = "black",
vertex.frame.color = "white",
edge.arrow.size = 0.5,
edge.lty = E(org_graph)$lty,
edge.color = E(org_graph)$color,
main = "My Workplace Network (solid = same team, dashed = cross-team)"
)
Many of who I work with are on cross-teams but it seems that my supervisor is the central point of the network which makes sense since she’s involved with both employees at my level and reporting to higher leadership.Without her as the central link,I believe that many of the roles connecting to her would create distance between the analysts and the leadership team. Overall, I thought this was a great exercise to create visualizations based from cross-team collaboration.