我有数据帧,其中我必须分别减去第13行 - 第1行,第14行 - 第2行中的ib。我必须保留每个键的第12行,因为它是值。 您可以使用R
中的数据zz <- "S_No key ib new_ib
1 3A19Bangladesh 5215 5215
2 3A19Bangladesh 10543 10543
3 3A19Bangladesh 14346 14346
4 3A19Bangladesh 17642 17642
5 3A19Bangladesh 20423 20423
6 3A19Bangladesh 22838 22838
7 3A19Bangladesh 25400 25400
8 3A19Bangladesh 25880 25880
9 3A19Bangladesh 29400 29400
10 3A19Bangladesh 32000 32000
11 3A19Bangladesh 32960 32960
12 3A19Bangladesh 32960 32960
13 3A19Bangladesh 32960 27745
14 3A19Bangladesh 32960 22417
15 3A19Bangladesh 32960 18614
1 3A19Belarus 364 364
2 3A19Belarus 1140 1140
3 3A19Belarus 2085 2085
4 3A19Belarus 3100 3100
5 3A19Belarus 4007 4007
6 3A19Belarus 5331 5331
7 3A19Belarus 7078 7078
8 3A19Belarus 7078 7078
9 3A19Belarus 7878 7878
10 3A19Belarus 8878 8878
11 3A19Belarus 9378 9378
12 3A19Belarus 9378 9378
13 3A19Belarus 9378 9014
14 3A19Belarus 9378 8238
15 3A19Belarus 9378 7293"
Data <- read.table(text=zz, header = TRUE)