I am trying to store two numerical arrays in an unusal form, e.g. c('[1;2;3]','[4;5;6]','[24;25;26]')
I need them in a CSV in single cells, like here

So far I tried this:
DF
ID time Y
1 3 23
1 4 24
1 5 20
2 2 12
2 8 15
3 2 19
3 3 23
3 5 21
3 6 32
timeList = list()
yList = list()
for (i in 1:3) {
timeList[i] = DF$time
yList[i] = DF$Y
}
longTimeList …Run Code Online (Sandbox Code Playgroud)