I need a column (y) added to my df, in which is repeated 8 times the "1", then 8 times the "2", then 8 times the "3", then 8 times the "4", etc.
It should be as long as the df is. See example output.
If the df does NOT have a length of a multiply of 8, the last repetitive numeric element does NOT have to be 8 times (see 3 times "5" in the example at the end).
Thank you.
> df1
y
1 1
2 1
3 1
4 1
5 1
6 1
7 1
8 1
9 2
10 2
11 2
12 2
13 2
14 2
15 2
16 2
17 3
18 3
19 3
20 3
21 3
22 3
23 3
24 3
25 4
26 4
27 4
28 4
29 4
30 4
31 4
32 4
33 5
34 5
35 5