Search code examples
rdataframeremoveallblank-line

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

Screen capture

821,824,833. I'm looking for a way to completely delete these lines. Thanks


Solution

  • @Rui Barradas, Your suggestion solved the problem.

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

    The same problem already existed as another issue. But they offered a different solution, and it worked. Link is here