I’m importing some R data so decided to learn DataFrames manipulation in julia instead of doing it in R. I have a wide dataframe with some initial columns followed by four variables that span 12 columns, one for each month. I want them in long format arranged with month as a column. I used
stack() to successfully transform for the first monthly variable from 12 columns to 12 rows with:
df = stack(df, 5:16)
Then I tried to do all of the 12 column blocks simultaneously with:
df = stack(df, [5:16, 17:28, 29:40, 41:52])
but there was no method defined for an array of ranges.
Any ideas about a similarly powerful way to do multiple stack operations at the same time?