全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 R语言论坛
1253 3
2017-05-10
悬赏 10 个论坛币 未解决
在R中我想把这样一个list数据
> res$cond.ind
, , 1

          [,1]     
pair      Numeric,2
separator Numeric,0

, , 2

          [,1]     
pair      Numeric,2
separator Numeric,0

, , 3

          [,1]     
pair      Numeric,2
separator Numeric,0

, , 4

          [,1]     
pair      Numeric,2
separator Numeric,0

, , 5

          [,1]     
pair      Numeric,2
separator Numeric,0

, , 6

          [,1]     
pair      Numeric,2
separator Numeric,0

, , 7

          [,1]     
pair      Numeric,2
separator Numeric,0

, , 8

          [,1]     
pair      Numeric,2
separator 2        

, , 9

          [,1]     
pair      Numeric,2
separator 2        

, , 10

          [,1]     
pair      Numeric,2
separator 2        

, , 11

          [,1]     
pair      Numeric,2
separator 2        

, , 12

          [,1]     
pair      Numeric,2
separator 2        

, , 13

          [,1]     
pair      Numeric,2
separator 6        

, , 14

          [,1]     
pair      Numeric,2
separator 6        

, , 15

          [,1]     
pair      Numeric,2
separator 6        

, , 16

          [,1]     
pair      Numeric,2
separator 6        

, , 17

          [,1]     
pair      Numeric,2
separator Numeric,2

, , 18

          [,1]     
pair      Numeric,2
separator Numeric,2

, , 19

          [,1]     
pair      Numeric,2
separator Numeric,2

, , 20

          [,1]     
pair      Numeric,2
separator 2        
改成这样的list数据

[[1]]
[[1]][[1]]
NULL

[[1]][[2]]
NULL

[[1]][[3]]
[1] 2

[[1]][[4]]
integer(0)

[[1]][[5]]
[1] 2

[[1]][[6]]
NULL

[[1]][[7]]
[1] 6

[[1]][[8]]
NULL


[[2]]
[[2]][[1]]
NULL

[[2]][[2]]
NULL

[[2]][[3]]
NULL

[[2]][[4]]
integer(0)

[[2]][[5]]
NULL

[[2]][[6]]
[1] 1

[[2]][[7]]
[1] 1

[[2]][[8]]
[1] 1 5


[[3]]
[[3]][[1]]
NULL

[[3]][[2]]
NULL

[[3]][[3]]
NULL

[[3]][[4]]
integer(0)

[[3]][[5]]
[1] 2

[[3]][[6]]
[1] 1

[[3]][[7]]
integer(0)

[[3]][[8]]
[1] 2


[[4]]
[[4]][[1]]
NULL

[[4]][[2]]
NULL

[[4]][[3]]
NULL

[[4]][[4]]
NULL

[[4]][[5]]
integer(0)

[[4]][[6]]
integer(0)

[[4]][[7]]
integer(0)

[[4]][[8]]
integer(0)


[[5]]
[[5]][[1]]
NULL

[[5]][[2]]
NULL

[[5]][[3]]
NULL

[[5]][[4]]
NULL

[[5]][[5]]
NULL

[[5]][[6]]
NULL

[[5]][[7]]
[1] 6

[[5]][[8]]
NULL


[[6]]
[[6]][[1]]
NULL

[[6]][[2]]
NULL

[[6]][[3]]
NULL

[[6]][[4]]
NULL

[[6]][[5]]
NULL

[[6]][[6]]
NULL

[[6]][[7]]
NULL

[[6]][[8]]
[1] 1 5


[[7]]
[[7]][[1]]
NULL

[[7]][[2]]
NULL

[[7]][[3]]
NULL

[[7]][[4]]
NULL

[[7]][[5]]
NULL

[[7]][[6]]
NULL

[[7]][[7]]
NULL

[[7]][[8]]
[1] 6


[[8]]
[[8]][[1]]
NULL

[[8]][[2]]
NULL

[[8]][[3]]
NULL

[[8]][[4]]
NULL

[[8]][[5]]
NULL

[[8]][[6]]
NULL

[[8]][[7]]
NULL

[[8]][[8]]
NULL
应该怎么办?

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2017-5-10 15:27:08
其实第一种结构中的pair就是第二种结构中的类似于元素下标的数据,而separate就是元素值。不知道能不能变换呢?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2017-6-19 19:28:07
我最后自己用R做了一个简单的循环,类似于把一个列向量转化成矩阵了,满足后面所需参数的结构就行了。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2017-6-19 19:29:23
前面回答了,忘了申请奖励。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群