在向量列表中删除Null向量

时间:2018-07-30 16:46:28

标签: r

如果我有一个向量列表,并且其中一个为空,我如何删除它,例如,我有这个列表:

[[1]]
{(2, 5), (3, 6), (4, 5), (5, 2), (5, 4), (5, 7), (6, 3), (6, 7), (7, 5), (7, 6)}

[[2]]
{(1, 4), (3, 4), (3, 6), (4, 1), (4, 3), (4, 5), (4, 6), (4, 7), (4, 8), (5, 4), (6, 3),
 (6, 4), (6, 7), (7, 4), (7, 6), (8, 4)}

[[3]]
{(1, 8), (2, 5), (2, 8), (4, 5), (4, 8), (5, 2), (5, 4), (5, 7), (7, 5), (7, 8), (8, 1),
 (8, 2), (8, 4), (8, 7)}

[[4]]
NULL

[[5]]
{(1, 8), (3, 6), (6, 3), (6, 8), (8, 1), (8, 6)}

[[6]]
{(2, 5), (4, 5), (5, 2), (5, 4)}

[[7]]
NULL

[[8]]
NULL

所以我想删除第四,第七和第八 谢谢

0 个答案:

没有答案