Numbering start from a given number

Hi!

How can I change episode to start a given number?

Data now:

Episode personID time
1 3 wx 2021-08-16
2 3 wx 2021-08-16
3 1 aaa 2021-08-16
4 1 aaa 2021-08-16
5 1 aaa 2021-08-16
6 2 oiy 2021-08-1

And I want that episode start form 100, like this:

Episode personID time
1 103 wx 2021-08-16
2 103 wx 2021-08-16
3 100 aaa 2021-08-16
4 100 aaa 2021-08-16
5 100 aaa 2021-08-16
6 102 oiy 2021-08-1

Could someone help me?

This doesnt make sense to me. if 1 should be 100, then 2 should be 101, and 3 -> 102 presumably
but your example seems to have 3 -> 103

Is there some special logic to consider ? or do you want to know how to add 99 to all the numbers ?

if you have a dataframe called mydf with a column Episode then (using base R)

mydf$Episode <- mydf$Episode + 99

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.