Re: [R] How to get R to ignore certain values when analyzing a column in a data table ?

From: Prof Brian Ripley <>
Date: Mon 10 Jul 2006 - 16:35:15 EST

On Sun, 9 Jul 2006, Daryl Manning wrote:

> Apologies if this is in (one of the many) manuals somewhere... Trying
> to switch to R from other stats programs.
> Basically, I have a large data table I've dumped from a DB, some of
> the values which are nulls '-' which I've converted to zeros. I've
> read it in using read.table fine.
> I want R to ignore the zero values when graphing or doing various
> other calculations.
> Is there a way to do this ?
> I did try to use NA but kept getting errors that x must be numeric.

Did you use numeric NA? That is the way to so this, so you will need to give a reproducible example (as the posting guide asks).

Brian D. Ripley,        
Professor of Applied Statistics,
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________ mailing list
PLEASE do read the posting guide!
Received on Mon Jul 10 16:42:27 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Mon 10 Jul 2006 - 18:15:25 EST.

Mailing list information is available at Please read the posting guide before posting to the list.