Guest User

Untitled

a guest
Dec 19th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. country <- c('A','A','A','B','B','C','C','C','C')
  2. year <- c(2010,2011,2015,2008,2009,2008,2009,2011,2015)
  3. score <- c(1,2,2,1,4,1,1,3,2)
  4.  
  5. country year score
  6. 1 A 2010 1
  7. 2 A 2011 2
  8. 3 A 2015 2
  9. 4 B 2008 1
  10. 5 B 2009 4
  11. 6 C 2008 1
  12. 7 C 2009 1
  13. 8 C 2011 3
  14. 9 C 2015 2
  15.  
  16. country year score change
  17. 1 A 2010 1 NA
  18. 2 A 2011 2 1
  19. 3 A 2015 2 0
  20. 4 B 2008 1 NA
  21. 5 B 2009 4 3
  22. 6 C 2008 1 NA
  23. 7 C 2009 1 0
  24. 8 C 2011 3 2
  25. 9 C 2015 2 -0.33
  26.  
  27. country avg_change
  28. 1 A 0.5
  29. 2 B 3
  30. 3 C 0.55
Add Comment
Please, Sign In to add comment