質問: 5, then i would like to collapse row 1 and 2 to get on...
回答: are you looking for something like this? df <- data.frame(a = 1:15, b = 11:25, c = 21:35) df #> a b c #> 1 1 11 21 #> 2 2 12 22 #> 3 3 13 23 #> 4 4 14 24 #> 5 5 15 25 #> 6 6 16 26 #> 7 7 17 27 #> 8 8 18 28 #> 9 9 19 29 #> 10 10 20 30 #> 11 ...