I have a numeric matrix with 15000 columns. I want to completely remove the columns where all values are 0.
col1 col2 col3 col4
row1 1 0 0 1
row2 3.4 0 0 2.4
row3 0.56 0 0 0
row4 0 0 0 0
Here I want to delete columns col2 and col3, and keep the rest.
How can I do it with R?
Thanks
How about this, using
applyandall: