I have a data structure like the following
stat_names values
stat1 0.3
stat2 0.5
stat_x ...
stat 16 0.8
and I would like to convert it to a similar structure, so that every 4 rows a new column is created and those 4 rows are moved to the new column.
A B C D
stat1 stat5 stat9 stat13
stat2 stat6 stat10 stat11`
... ... ... ...
Where "A", "B", "C", "D" is a a-priori user-defined column names vector.
Although this is trivial to do by hand in Excel, I would like to do this in R with a script that can be iterated across multiple inputs.