Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. library(tidyverse)
  2. library(tidygraph)
  3. library(ggraph)
  4.  
  5. relations <- as_tbl_graph(
  6. tribble(
  7. ~from, ~to, ~method, ~data, ~attitude,
  8. "statistics", "math", "probability", NA, "detachment from reality",
  9. "statistics", "psychology", "hypothesis testing", "WEIRD experiments", "internal turmoil",
  10. "statistics", "economics", "instrumental variables", "government statistics", "gotta identify my linear model",
  11. "statistics", "finance", "times series but with AI", "stocks", "$$$",
  12. "statistics", "data science", "anything actually practical", "dirty", "can do",
  13. "statistics", "ecology", "HMMs and GAMS", "animal stuff", "social skills",
  14. "statistics", "biostatistics", "GWAS", "RNA Seq", "save the world"
  15. )
  16. )
  17.  
  18. ggraph(relations) +
  19. geom_node_text(aes(label = name), size = 5) +
  20. geom_edge_fan(
  21. aes(label = method),
  22. angle_calc = "along",
  23. label_dodge = unit(2.5, 'mm'),
  24. arrow = arrow(length = unit(4, 'mm')),
  25. start_cap = circle(8, 'mm'),
  26. end_cap = circle(8, 'mm')
  27. ) +
  28. theme_graph()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement