[R] Load Ascii file in R

ripley@stats.ox.ac.uk ripley at stats.ox.ac.uk
Tue Aug 13 12:26:40 CEST 2002


How did you get such a file?

My guess is that you transferred the file from some other machine and
mangled the line endings en route.  As the following shows,

> save(ls, file="foo", ascii=T)
> load("foo")

it does work, and the file is written with LF and not CRLF line endings.
If I convert that file to CRLF line endings I get the error you report.

The solution seems to be to either convert the file to LF in a good
editor, or to track down where it is getting corrupted.


On Tue, 13 Aug 2002 SHEN_MO_JUN at lilly.com wrote:

> Hi,
>
> I am using R-1.5.1 on windows 2000.  I encountered  a problem when I tried
> to load a ascii .RData file
> whose first line is "RDA2". The error message is "restore file may be from
> a newer version of R -- no
> data loaded".
>
> I noticed that the error comes from magic comparison when load file.  The
> magic comparision of  the first
> five characters in the ascii file and the "RDA2\n" is always fail, and
> then comparison of "RD" is successful.
>
> How can I solve the issue if I'd not like to recompile the source code?

How did you manage to find out what the binary code was doing without
building a debug version?

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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