An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20080916/dcdf16d9/attachment.pl>
HI
4 messages · Amit Patel, Johannes Hüsing, Nutter, Benjamin +1 more
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")
Perhaps a simpler way might be to use the na argument in read.table. for instance:
read.table( filename, na=0, ...)
-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
On Behalf Of Amit Patel
Sent: Tuesday, September 16, 2008 9:32 AM
To: r-help at r-project.org
Subject: [R] HI
Does anyone know an easy way to convert all the zero values in a
imported csv table into NA's
______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
===================================
P Please consider the environment before printing this e-mail
Cleveland Clinic is ranked one of the top hospitals
in America by U.S. News & World Report (2008).
Visit us online at http://www.clevelandclinic.org for
a complete listing of our services, staff and
locations.
Confidentiality Note: This message is intended for use\...{{dropped:13}}
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20080917/0524ad62/attachment.pl>