Dear Ben,
Since readLines() returns the lines in the file as character strings,
it wouldn't be appropriate for it to substitute for missing values on
input. One approach would be to replace "-99.99" with "NA"
in the
strings, but a simpler method would be to deal with the data frame (say
DF):
DF[DF == -99.99] <- NA
(assuming that you've converted the strings to numeric values).
I hope this helps,
John
On Tue, 1 Mar 2005 13:43:23 -0500
"Benjamin M. Osborne" <Benjamin.Osborne at uvm.edu>
wrote:> When reading a data set into R using readLines,
na.strings="-99.99"
> is ignored.
> Is there an equivalent command for readLines? Alternatively, either
> immediately after reading into R or once the data set has been
> converted to a
> data frame, what is the appropriate command (or appropriate use of
> is.na) to
> convert my -99.99s to NAs?
> Thanks,
> Ben Osborne
>
> --
> Botany Department
> University of Vermont
> 109 Carrigan Drive
> Burlington, VT 05405
>
> benjamin.osborne at uvm.edu
> phone: 802-656-0297
> fax: 802-656-0440
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
--------------------------------
John Fox
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
http://socserv.mcmaster.ca/jfox/