I am looking for a solution to split dataframes into smaller parts with specified length and then rearrange those parts into a new dataframe. The goal is to fit more data on a single page when printing narrow tables. For example this:
index v1
1 a
2 a
3 d
4 f
5 f
6 g
7 a
8 a
9 x
10 d
11 d
12 x
13 e
14 a
15 a
16 d
17 c
18 f
19 e
20 e
21 c
into this:
index v1 index v1
1 a 7 a
2 a 8 a
3 d 9 x
4 f 10 d
5 f 11 d
6 g 12 x
13 e 19 e
14 a 20 e
15 a 21 c
16 d
17 c
18 f
In this example we split after every 6th row and arrange into two column sections (if we had a page that could fit 6 rows only). It would be nice to have split points and column section counts as variables. And how to reverse the process to make a regular table again for data analysis after extra data has been entered in Excel for example?