RE: [R] how to remove "." or replace it with NA?

About this list Date view Thread view Subject view Author view Attachment view

From: John Fox (jfox@mcmaster.ca)
Date: Sun 30 May 2004 - 13:14:28 EST


Message-id: <20040530031428.WXD24047.tomts10-srv.bellnexxia.net@JohnDesktop8300>

Dear Yong Wang,

When you read the data with read.table, specify the argument na.strings=".".
See ?read.table for details.

I hope that this helps,
 John

> -----Original Message-----
> From: r-help-bounces@stat.math.ethz.ch
> [mailto:r-help-bounces@stat.math.ethz.ch] On Behalf Of Yong Wang
> Sent: Saturday, May 29, 2004 8:25 PM
> To: r-help@stat.math.ethz.ch
> Subject: [R] how to remove "." or replace it with NA?
>
> Hi,all
> a quick question
> A larger file include many"." (stands for missing
> value) for variable, say, x. after
> read in the file and assign it another name such as :
>
> x1<-data$x
>
> but x1 is always a facotor but not numerical.
>
> so How can I get a numeric vector from the read in data frame.
> how can I replace those "." with "NA" to perform analysis.
>
> thank you very much
> best regards
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Mon 31 May 2004 - 23:05:14 EST