I have a dataframe like x where the column genes is a factor. I want to remove all the rows where column genes has nothing. So in table X I want to remove row 4. Is there a way to do this for a large dataframe?
X
names values genes
1 A 0.2876113 EEF1A1
2 B 0.6681894 GAPDH
3 C 0.1375420 SLC35E2
4 D -1.9063386
5 E -0.4949905 RPS28
Finally result:
X
names values genes
1 A 0.2876113 EEF1A1
2 B 0.6681894 GAPDH
3 C 0.1375420 SLC35E2
5 E -0.4949905 RPS28
Thank you all!
It’s not completely obvious from your question what the empty values are, but you should be able to adopt the solution below (here I assume the ’empty’ values are empty strings):