# Load required librarieslibrary(tidyverse) # For data manipulation and visualizationlibrary(tidygraph) # For network analysis and manipulationlibrary(ggraph) # For network visualization# Load the datascholar_nodes <-read_csv("module-0/data/scholar-nodes-2024.csv") # Load node data from CSVscholar_edges <-read_csv("module-0/data/scholar-edges-2024.csv") # Load edge data from CSV# Create a tidygraph objectscholar_network <-tbl_graph(nodes = scholar_nodes, edges = scholar_edges,directed =TRUE) # Create a directed network graph from the nodes and edges# Plot the networkggraph(scholar_network, layout ="stress") +geom_edge_link(arrow =arrow(length =unit(1, 'mm')), end_cap =circle(3, 'mm'),start_cap =circle(3, 'mm'),alpha = .08) +# Draw edges with arrows, adjusting transparency and end/start capsgeom_node_point(aes(size =local_size(),color = attribute)) +# Draw nodes with size based on local size and color based on attributegeom_node_text(aes(label = name,size =local_size()),repel =TRUE) +# Add node labels, with text size based on local size, using repulsion to avoid overlaplabs(title ="LASER Scholars Scavenger Hunt Network",color ="Selected most for:") +# Add a title to the plot and set the legend title for colorscale_size_continuous(range =c(3, 5)) +# Scale the node sizes to be within a specified rangeguides(size ="none") +# Remove the size legendtheme_graph() +# Apply a theme suitable for graphstheme(plot.title =element_text(hjust =0.5), # Center the plot titlelegend.text =element_text(size =12)) # Increase the legend text size
Source Code
---title: "LASER Scholars Scavenger Hunt"author: "LASER Institute"date: today format: html: toc: true toc-depth: 4 toc-location: right code-fold: show messages: false code-tools: source: true toggle: true caption: nonetheme: light: simplex dark: cyborgeditor: visualbibliography: lit/references.bib---### Sociogram```{r}#| echo: false#| warning: false#| messages: false# Load required librarieslibrary(tidyverse) # For data manipulation and visualizationlibrary(tidygraph) # For network analysis and manipulationlibrary(ggraph) # For network visualization# Load the datascholar_nodes <-read_csv("module-0/data/scholar-nodes-2025.csv") # Load node data from CSVscholar_edges <-read_csv("module-0/data/scholar-edges-2025.csv") # Load edge data from CSV# Create a tidygraph objectscholar_network <-tbl_graph(nodes = scholar_nodes, edges = scholar_edges,directed =TRUE) # Create a directed network graph from the nodes and edges# Plot the networkggraph(scholar_network, layout ="stress") +geom_edge_link(arrow =arrow(length =unit(1, 'mm')), end_cap =circle(3, 'mm'),start_cap =circle(3, 'mm'),alpha = .08) +# Draw edges with arrows, adjusting transparency and end/start capsgeom_node_point(aes(size =local_size(),color = attribute)) +# Draw nodes with size based on local size and color based on attributegeom_node_text(aes(label = name,size =local_size()),repel =TRUE) +# Add node labels, with text size based on local size, using repulsion to avoid overlaplabs(title ="LASER Scholars Scavenger Hunt Network",color ="Selected most for:") +# Add a title to the plot and set the legend title for colorscale_size_continuous(range =c(2, 3.5)) +# Scale the node sizes to be within a specified rangeguides(size ="none") +# Remove the size legendtheme_graph() +# Apply a theme suitable for graphstheme(plot.title =element_text(hjust =0.5), # Center the plot titlelegend.text =element_text(size =12)) # Increase the legend text size```### Code```{r}#| messages: false#| warning: false#| output: false# Load required librarieslibrary(tidyverse) # For data manipulation and visualizationlibrary(tidygraph) # For network analysis and manipulationlibrary(ggraph) # For network visualization# Load the datascholar_nodes <-read_csv("module-0/data/scholar-nodes-2024.csv") # Load node data from CSVscholar_edges <-read_csv("module-0/data/scholar-edges-2024.csv") # Load edge data from CSV# Create a tidygraph objectscholar_network <-tbl_graph(nodes = scholar_nodes, edges = scholar_edges,directed =TRUE) # Create a directed network graph from the nodes and edges# Plot the networkggraph(scholar_network, layout ="stress") +geom_edge_link(arrow =arrow(length =unit(1, 'mm')), end_cap =circle(3, 'mm'),start_cap =circle(3, 'mm'),alpha = .08) +# Draw edges with arrows, adjusting transparency and end/start capsgeom_node_point(aes(size =local_size(),color = attribute)) +# Draw nodes with size based on local size and color based on attributegeom_node_text(aes(label = name,size =local_size()),repel =TRUE) +# Add node labels, with text size based on local size, using repulsion to avoid overlaplabs(title ="LASER Scholars Scavenger Hunt Network",color ="Selected most for:") +# Add a title to the plot and set the legend title for colorscale_size_continuous(range =c(3, 5)) +# Scale the node sizes to be within a specified rangeguides(size ="none") +# Remove the size legendtheme_graph() +# Apply a theme suitable for graphstheme(plot.title =element_text(hjust =0.5), # Center the plot titlelegend.text =element_text(size =12)) # Increase the legend text size```