creating a column with 11111,22222,3333 repetitions but unable to find library to do that .

I have this data , and the column named Shift needs to have 1,2 and 3 shift only, however it goes up to 120,every 3 role of ascendents numbers should be 1,2 and 3 not with ascendent sequence up to 120.
How could I posibly do that.?

Could you find a different way to explain what you want to achieve ?
by what rule should the number SHIFT be set ?

1 Like

thank you for answering , this is what I want to do .

(df_ <- data.frame(shift=rep(1:8,each=3)))
df_$shift2  <- 1+((df_$shift-1) %%3)
1 Like

thank you very much! it worked perfectly :sob:
Thank you!

This topic was automatically closed 7 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.