From the simple R example of reshape here, given a List of Maps like this:
data = [ [ id: 1, time: 1, x1: 5, x2: 6 ],
[ id: 1, time: 2, x1: 3, x2: 5 ],
[ id: 2, time: 1, x1: 6, x2: 1 ],
[ id: 2, time: 2, x1: 2, x2: 4 ] ]
And the methods melt
: