[R] Unwanted Levels in R

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Tue May 21 15:46:58 CEST 2002


"MATT BORKOWSKI" <mpb170 at psu.edu> writes:

> is there anyway to overcome it?  Here are a few lines of the data I'm 
> attempting to read in:
> 
> A  900003024 ODEN   SWEDEN  ODEN91 NSIDC.ORG/PROJE 
> B     900003         -9  1 NAN OBS         0
> C 1991  9  7 13 -9 XX   90.0000     .0000 XX
> D    36   10.0   10.1 4183.0 4270.7 4219.0 Z 13  0 OBSERV
> E    -9.0   -9.0 -9.0000 -9.0000 -9.0000 -9.0000 -9.0000 -9.0000 -9.0000 
>    10.0   10.1 -1.6970 -1.6971 31.4940 25.3287 34.8044 43.8535 -9.0000 
> 
> Here are the commands I have tried using to read in the data:
> 
> >alldata <- read.table("/home/mattb/xxx.dat", fill = TRUE, quote = "")
> 
> >alldata <- as.list(read.table("/home/mattb/xxx.dat", fill = TRUE, quote = "")

As far as I can see, there is no connection between values in the same
position in different lines? If so, trying to make a data frame out of
the file is simply inappropriate and you should rather use ReadLines
and postprocess the lines according to whatever logic they are
supposed to obey.

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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 at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list