Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201945

Row Index where all Columns meet one Criterion

$
0
0

I got this dataframe:

df <- data.frame(
    a = c("1", "2", "", "")
    , b = c("1", "", "3", "")
)

  a b
1 1 1
2 2  
3   3
4    

I want to indentify (and then actually remove) the rows where all columns fulfill one particular criterion - in this case == ""

Desired output:

  a b
1 1 1
2 2  
3   3

Viewing all articles
Browse latest Browse all 201945

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>