【发布时间】:2019-05-08 19:16:20
【问题描述】:
我的数据如下所示:
x y z
1 na na 4
2 na na 5
3 na 4 na
4 na 2 na
5 7 na na
6 9 na na
我尝试粘贴和合并,但输出如下所示:
x
1 na na 4
2 na na 4
3 na 4 na
我只想要数字,并且只希望它们在一列中。这就是我想要的:
x
1 4
2 5
3 4
4 2
5 7
6 9
你们知道怎么做吗?你会对我有很大的帮助!谢谢!
【问题讨论】:
-
@akrun You can instantly reopen any question closed as a duplicate that was originally asked with a tag you have a gold badge for。 if you have a gold tag-badge for a tag associated with a question that's been closed as a duplicate, you can edit the duplicate links to replace, add, remove or re-arrange them.
-
@anjama 该帖子有几个使用
dplyr::coalesce或相同类型函数的其他实现的答案。答案变得复杂,因为部分问题是关于衡量效率,但解决方案本身应该涵盖它
标签: r