[R] Delete Columns with zeros

From: Jens Oldeland <Oldeland_at_gmx.de>
Date: Thu, 31 Jan 2008 15:33:20 +0100


I know there have been some discussions on that topic. all their solutions failed in my case...
My problem is that I have a dataframe with many zeros. but while plotting they are not useful.
so I want to get rid of column 1,3,4,......,n i have 628 columns 1000 rows, so I can´t look manually for the "empty" columns.

Any possible Ideas?

> A250[1:5,1:4]

A1100 0 0.0 0 0
A20100 0 0.1 0 0
A20200 0 0.0 0 0
A400 0 1.0 0 0
A4100 0 0.0 0 0

I also didn´t find anything useful in "An Introduction to R".

thank you


Dipl.Biol. Jens Oldeland
University of Hamburg
Biocentre Klein Flottbek and Botanical Garden
Ohnhorststr. 18
22609 Hamburg,

Tel:    0049-(0)40-42816-407
Fax:    0049-(0)40-42816-543
Mail: 	Oldeland_at_botanik.uni-hamburg.de
        Jens.Oldeland_at_DLR.de  (for attachments > 2mb!!)

R-help_at_r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Thu 31 Jan 2008 - 14:40:18 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 31 Jan 2008 - 16:30:11 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive