I have 2 datasets that I am about to stack together. Please note that record_ids for the first dataset also start at 1
record_id any_column
591 a
591 b
591 c
592 d
592 e
592 f
592 g
593 h
593 i
593 j
2nd dataset
record_id any_column
1 a
1 b
1 c
2 d
2 e
2 f
2 g
3 h
3 i
3 j
when stacking I want record_ids for the 2nd data set to start right where the recod_ids for the 1st dataset ended for instant in this case at 593
, I would like to convert ids for the 2nd dataset to something starting at 594
and so forth. How can I best approach this? Thanks
The expectations for the future datasets are as follows:
record_id any_column grand_id
591 a 591
591 b 591
591 c 591
592 d 592
592 e 592
592 f 592
592 g 592
593 h 593
593 i 593
593 j 593
1 a 594
1 b 594
1 c 594
2 d 595
2 e 595
2 f 595
2 g 595
3 h 596
3 i 596
3 j 596
You can get
max
ofrecord_id
fromdf1
and add to itrecord_id
ofdf2
.If you prefer
dplyr
: