Re: [R] read.table and missing values - solved

About this list Date view Thread view Subject view Author view

From: Peter Breuer (pbreuer@uni-goettingen.de)
Date: Wed 20 Jun 2001 - 01:08:52 EST


Message-Id: <a05010404b755187c307b@[134.76.136.128]>

Thanks - everything is o.k. and working

>a,b,c
>1,2,3
>4,,6
>,8,9
>
>I get
>
>> read.table("foo.dat", header=T, sep=",")
> a b c
>1 1 2 3
>2 4 NA 6
>3 NA 8 9
>
>as advertised.
>
>You have set sep="\t", haven't you? The default separator is white space,
>and that will swallow two tabs. The following had tabs in originally,

This did solve the problem. I didn't set sep="\t". R read complete
tab delimited data files nontheless and complained only when it met
missing data.
This confused me.

>
>a b c
>1 2 3
>4 6
> 8 9
>
>and gives
>
>> read.table("foo.dat", header=T, sep="\t")
> a b c
>1 1 2 3
>2 4 NA 6
>3 NA 8 9
>
>So, if you do that it should work for you too. And if you want to claim
>on R-help that things do not work, please include an example so we can see
>what you are doing (or not doing).
>
sorry for having missed to send an example.

Peter

-- 
---------------------------------------------------------------------
Peter Breuer, http://www.psych.uni-goettingen.de/home/breuer
Georg-Elias-Mueller-Inst. f. Psychologie, Gosslerstr. 14, 37073 
Goettingen, Germany
Tel: (+49)551-39-3588,  Fax: (+49)551-39-3662
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


About this list Date view Thread view Subject view Author view

This archive was generated by hypermail 2b30 : Fri 22 Jun 2001 - 18:58:45 EST