[R] Unwanted Levels in R
MATT BORKOWSKI
mpb170 at psu.edu
Tue May 21 15:34:21 CEST 2002
I searched the mailing list archives and found one post relevant to my problem,
but it was not specific enough to solve my problem.
I am reading in a large file of data (I believe it is in ASCII format). I have tried
reading the file in as a data frame and as a list, and both methods result in
unwanted levels being created which leads to problems when I try to copy
or reference certain cells. I suspect the problem may be because there are
character strings randomly intersparsed with numeric data. If this is the problem,
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 = "")
Thanks for your time,
Matt
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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