小编mjs*_*mjs的帖子

converting numeric arrays into list and savig in CSV in R

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

最终的 CSV

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)

csv arrays r

2
推荐指数
1
解决办法
40
查看次数

标签 统计

arrays ×1

csv ×1

r ×1