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 11 21 31
#> 12 12 22 32
#> 13 13 23 33
#> 14 14 24 34
#> 15 15 25 35
indices_of_rows_to_merge <- c(1, 4, 9, 3, 2, 8, 6, 7)
index_of_row_where_to_merge <- 2
df[index_of_row_where_to_merge,] <- colSums(x = df[indices_of_rows_to_merge,])
df <- df[- indices_of_rows_to_merge[!(indices_of_rows_to_merge %in% index_of_row_where_to_merge)],]
df
#> a b c
#> 2 40 120 200
#> 5 5 15 25
#> 10 10 20 30
#> 11 11 21 31
#> 12 12 22 32
#> 13 13 23 33
#> 14 14 24 34
#> 15 15 25 35
Created on 2019-03-20 by the reprex package (v0.2.1)