Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- df<-data.frame(stringsAsFactors=FALSE,
- Subject = c("Arts", "History", "Maths", "French", "HomeEc"),
- student_1 = c(50L, 51L, 52L, 53L, 54L),
- student_2 = c(67L, 68L, 69L, 70L, 71L),
- student_3 = c(82L, 83L, 84L, 85L, 86L))
- Subject student_1 student_2 student_3
- 1 Arts 50 67 82
- 2 History 51 68 83
- 3 Maths 52 69 84
- 4 French 53 70 85
- 5 HomeEc 54 71 86
- df2<-data.frame(stringsAsFactors=FALSE,
- Subject = c("Arts", "History", "Maths", "Spanish", "Photography"),
- student_4 = c(40L, 41L, 42L, 43L, 44L),
- student_5 = c(71L, 72L, 73L, 74L, 75L),
- student_6 = c(92L, 93L, 94L, 95L, 96L)
- )
- Subject student_4 student_5 student_6
- 1 Arts 40 71 92
- 2 History 41 72 93
- 3 Maths 42 73 94
- 4 Spanish 43 74 95
- 5 Photography 44 75 96
- Subject student_1 student_2 student_3 student_4 student_5 student_6
- 1 Arts 50 67 82 40 71 92
- 2 History 51 68 83 41 72 93
- 3 Maths 52 69 84 42 73 94
- 4 French 53 70 85 NA NA NA
- 5 HomeEc 54 71 86 NA NA NA
- 6 Spanish NA NA NA 43 74 95
- 7 Photography NA NA NA 44 75 96
Add Comment
Please, Sign In to add comment