s-news
[Top] [All Lists]

Re: S-PLUS: na.omit on data.frame columns

To: "Bill Osburn" <bosburn@sjrwmd.com>, <s-news@lists.biostat.wustl.edu>
Subject: Re: S-PLUS: na.omit on data.frame columns
From: "Samer Mouksassi" <smouksassi@Pharsight.com>
Date: Mon, 2 Feb 2009 11:34:55 -0800
In-reply-to: <9E9563D3FAECF9448B370F988FD6BD153A293695E4@MAILSVR.sjrwmd.com>
References: <9E9563D3FAECF9448B370F988FD6BD153A293695E4@MAILSVR.sjrwmd.com>
Thread-index: AcmFaiBGejv7kbokQjiUCgI1Y+FN2wAAwRVw
Thread-topic: [S] S-PLUS: na.omit on data.frame columns

 

Hello Bill,

 

Another way would be:

 

apply(YOURDATAFRAME,2,anyMissing)

 

this will give you which column contains missing values or not.

 

Bests,

 

Samer

 

 

Samer Mouksassi, Pharm.D.

Senior Associate (PK Scientist)
smouksassi@Pharsight.com
Pharsight Corporation
(http://pharsight.com/main.php)

Reporting and Analysis Services (RAS)
(http://pharsight.com/services/ras_home.php)

2000 Peel Street, Suite 570

Montreal, Quebec

H3A 2W5 CANADA

Land: (514) 789-2184

Fax:  (514) 789-2192
Cell:  (514) 475-9339

 


From: s-news-owner@lists.biostat.wustl.edu [mailto:s-news-owner@lists.biostat.wustl.edu] On Behalf Of Bill Osburn
Sent: 2009-02-02 14:12
To: 's-news@lists.biostat.wustl.edu'
Subject: [S] S-PLUS: na.omit on data.frame columns

 

I have a data.frame and want to remove all columns where there is an NA. So far I can only get na.omit to work on rows.

 

After googling for several hours I still can’t locate any ideas. Has anyone done na.omit or something, on columns?

 

With my current data.frame I should go from 16x78 to 16x28

<Prev in Thread] Current Thread [Next in Thread>