Skip to content
Back to skills

R Network Viz

ASecurity

R network visualization with ggraph, visNetwork. Use for graph layouts and interactive networks.

  • 5 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added June 4, 2026
datagonode

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned June 4, 2026

npx -y skills add LeoLin990405/r-analytics-skill --skill r-network-viz --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of R Network Viz?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for R Network Viz
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/leolin990405-r-network-viz/badge)](https://www.skillsdirectory.com/skills/leolin990405-r-network-viz)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: r-network-viz
description: R network visualization with ggraph, visNetwork. Use for graph layouts and interactive networks.
---

# R Network Visualization

Graph visualization.

## ggraph

```r
library(ggraph)
library(tidygraph)

# Convert to tbl_graph
tg <- as_tbl_graph(g)

# Basic plot
ggraph(tg, layout = "fr") +
  geom_edge_link() +
  geom_node_point()

# Layouts
ggraph(tg, layout = "kk")      # Kamada-Kawai
ggraph(tg, layout = "fr")      # Fruchterman-Reingold
ggraph(tg, layout = "circle")
ggraph(tg, layout = "tree")
ggraph(tg, layout = "stress")

# Styled
ggraph(tg, layout = "fr") +
  geom_edge_link(aes(alpha = weight), show.legend = FALSE) +
  geom_node_point(aes(size = centrality, color = community)) +
  geom_node_text(aes(label = name), repel = TRUE) +
  theme_graph()

# Edge types
geom_edge_link()
geom_edge_arc()
geom_edge_fan()
geom_edge_diagonal()
```

## visNetwork

```r
library(visNetwork)

# Basic
visNetwork(nodes, edges)

# Options
visNetwork(nodes, edges) %>%
  visOptions(
    highlightNearest = TRUE,
    nodesIdSelection = TRUE,
    selectedBy = "group"
  ) %>%
  visLayout(randomSeed = 123) %>%
  visPhysics(stabilization = FALSE)

# From igraph
visIgraph(g)

# Hierarchical
visNetwork(nodes, edges) %>%
  visHierarchicalLayout(direction = "UD")
```

## networkD3

```r
library(networkD3)

# Force network
forceNetwork(Links = edges, Nodes = nodes, Source = "from", Target = "to",
             NodeID = "name", Group = "group")

# Sankey
sankeyNetwork(Links = links, Nodes = nodes, Source = "source", Target = "target",
              Value = "value", NodeID = "name")

# Simple network
simpleNetwork(edges)
```

Files in this skill

  • SKILL.md1.6 KB
  • ggraph/SKILL.md1.9 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…