Guest User

Untitled

a guest
Jul 18th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. df<-data.frame(stringsAsFactors=FALSE,
  2. Subject = c("Arts", "History", "Maths", "French", "HomeEc"),
  3. student_1 = c(50L, 51L, 52L, 53L, 54L),
  4. student_2 = c(67L, 68L, 69L, 70L, 71L),
  5. student_3 = c(82L, 83L, 84L, 85L, 86L))
  6.  
  7.  
  8. Subject student_1 student_2 student_3
  9. 1 Arts 50 67 82
  10. 2 History 51 68 83
  11. 3 Maths 52 69 84
  12. 4 French 53 70 85
  13. 5 HomeEc 54 71 86
  14.  
  15. df2<-data.frame(stringsAsFactors=FALSE,
  16. Subject = c("Arts", "History", "Maths", "Spanish", "Photography"),
  17. student_4 = c(40L, 41L, 42L, 43L, 44L),
  18. student_5 = c(71L, 72L, 73L, 74L, 75L),
  19. student_6 = c(92L, 93L, 94L, 95L, 96L)
  20. )
  21.  
  22. Subject student_4 student_5 student_6
  23. 1 Arts 40 71 92
  24. 2 History 41 72 93
  25. 3 Maths 42 73 94
  26. 4 Spanish 43 74 95
  27. 5 Photography 44 75 96
  28.  
  29. Subject student_1 student_2 student_3 student_4 student_5 student_6
  30. 1 Arts 50 67 82 40 71 92
  31. 2 History 51 68 83 41 72 93
  32. 3 Maths 52 69 84 42 73 94
  33. 4 French 53 70 85 NA NA NA
  34. 5 HomeEc 54 71 86 NA NA NA
  35. 6 Spanish NA NA NA 43 74 95
  36. 7 Photography NA NA NA 44 75 96
Add Comment
Please, Sign In to add comment