Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(tidyverse)
- df <- tribble(
- ~year, ~country, ~series1, ~series2,
- #--|--|--|----
- 2003, "USA", 8, 5,
- 2004, "USA", 9, 6,
- 2005, "USA", 11, 7,
- 2006, "USA", 10, 8,
- 2007, "USA", 11, 4,
- 2008, "USA", 14, 10,
- 2009, "USA", 16, 12,
- 2010, "USA", 12, 8,
- 2011, "USA", 12, 13,
- 2012, "USA", 13, 10,
- 2013, "USA", 11, 5,
- 2005, "FRA", 5, 6,
- 2006, "FRA", 6, 8,
- 2007, "FRA", 5, 7,
- 2008, "FRA", 4, 8,
- 2009, "FRA", 9, 11,
- 2010, "FRA", 7, 9,
- 2011, "FRA", 14, 11,
- 2012, "FRA", 7, 11,
- 2013, "FRA", 6, 6,
- 2014, "FRA", 5, 7,
- 2015, "FRA", 4, 5
- )
- ggplot(df, aes(x = series1, y = series2, color = country)) +
- geom_point() +
- geom_segment(aes(x = 4, xend=6, y = 11, yend=8),
- arrow = arrow(length = unit(0.5, "cm")))
Add Comment
Please, Sign In to add comment