简体   繁体   English

如何完全删除R中具有空单元格的行?

[英]How do I completely delete a row with an empty cell in R?

I have an empty cell, but I want to delete it, even if there are cells (Even if it contains data) in the same row. 我有一个空单元格,但是即使同一行中有多个单元格(即使它包含数据),也要删除它。 As shown in the picture. 如图所示。

textparcali$word[!apply(textparcali$word == "", 1, all),]

Error in apply(textparcali$word == "", 1, all) : 
  dim(X) must have a positive length

屏幕截图

821,824,833. 821,824,833。 I'm looking for a way to completely delete these lines. 我正在寻找一种完全删除这些行的方法。 Thanks 谢谢

@Rui Barradas, Your suggestion solved the problem. @Rui Barradas,您的建议解决了这个问题。

textparcali<-textparcali[textparcali$word !="",]

The same problem already existed as another issue. 另一个问题已经存在相同的问题。 But they offered a different solution, and it worked. 但是他们提供了一个不同的解决方案,并且有效。 Link is here 链接在这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM