R的纵向排除R
我有一个宽格格式的大数据集,其中我从不同的时间点(W1,W2,W3 ...)和一个ID列中有9个数据波。我想排除仅在1个时间点或0个时间点上数据的参与者。 之前,我已经有条件地将参与者排除在以下代码中:
Result <- Merged[!(Merged$w1exclude >1),]
但是,我不确定如何调整代码以将W1-W9变量包含在其中9或8具有Na的情况下。
这是我在这里的第一篇文章,我对R的新手很抱歉,如果在我现在知道的其他地方回答了这一点。
I have a large dataset in wide format where I have 9 waves of data from different timepoints (w1, w2, w3...) and an ID column. I want to exclude participants who only have data on 1 timepoint or 0 timepoints.
Earlier, I have excluded participants conditionally with the following code:
Result <- Merged[!(Merged$w1exclude >1),]
However, I am unsure how to adapt the code to include the w1-w9 variables on the condition that 9 or 8 of them have NA's.
This is my first post here and I am new to R so apologies if this has been answered in a thread elsewhere I am now aware of.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这个问题可能与 dataframe in ROW 计数NAS
This question is potentially the same as Count NAs per row in dataframe