[R] HI

Johannes Huesing johannes at huesing.name
Tue Sep 16 16:01:27 CEST 2008


Amit Patel <amitrhelp at yahoo.co.uk> [Tue, Sep 16, 2008 at 03:32:01PM CEST]:
> Does anyone know an easy way to convert all the zero values in a imported csv table into NA's

Depends on the data structure you gave your imported table. In a single numeric vector (named, say, vec), the syntax is

is.na(vec[vec==0]) <- TRUE

-- 
Johannes Hüsing               There is something fascinating about science. 
                              One gets such wholesale returns of conjecture 
mailto:johannes at huesing.name  from such a trifling investment of fact.                
http://derwisch.wikidot.com         (Mark Twain, "Life on the Mississippi")



More information about the R-help mailing list