[R] problem with loadURL -- claims newer version used- fixed
William Revelle
revelle at northwestern.edu
Tue May 11 05:36:31 CEST 2004
>big5r.txt is delimited by CR not LF, and as R writes it as a binary file,
>that's not the file that got saved.
Thanks. That was the problem. I was transferring the files from my
Mac to my web server (also a Mac) using Interarchy. It was putting
in CRs rather than LFs (the Interarchy options were "old Mac cr" vs.
Unix (lf)"). Changing that transfer option makes it work.
>
>Same problem with the header on big5r.
>
>Try some octal dumps and find out which step is changing the file.
>
>BTW, I would use load(url(someURL)) these days.
load(url(someURL)) works (once I fixed the transfer to the server),
although I used the other form because I was following the help for
load. Perhaps the ?load comments could be modified to suggest
load(url(someURL)) instead of suggesting loadURL(someURL).
Thanks for the very rapid response.
Bill
>
>On Mon, 10 May 2004, William Revelle wrote:
>
>> Dear list,
>>
>> I am trying to prepare a handout showing how to use R for factor
>> analysis. As part of the exercise I want to save a correlation
>> matrix on a tutorial web page. I can save with no problem (saving
>> locally and then transferring to the web site). Although I can
>> load() the local file, I am having problems getting loadURL to read
>> the remote file. I have tried saving it as an ascii file or just
>> using the default format.
>>
>> Using R 1.9.0 on a Mac with OS 10.3
>>
>>
>> I first saved the file:
>> save(big5r,file="big5r.txt",ascii=TRUE)
>> and
>> save(big5r,file="big5r")
>> I can load either version from a local file using load().
>>
>> I then have moved these files to a webserver and tried to load them
>> using the loadURL() command.
>>
>> Using loadURL() I get the following message
>>
>> >loadURL("http://personality-project.org/r/datasets/big5r")
>> #the default format
>> Error: restore file may be from a newer version of R -- no data loaded
>> >loadURL("http://personality-project.org/r/datasets/big5r.txt")
>>#ascii format
>> Error: restore file may be from a newer version of R -- no data loaded
>>
>> I can list the second file using a web browser and I can move the
>> first file back to my machine and load it locally.
>> My problem seems to be with loadURL.
>>
>> Any help would be appreciated.
>>
>> Bill
>>
>>
>>
>
>--
>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 272866 (PA)
>Oxford OX1 3TG, UK Fax: +44 1865 272595
>
>______________________________________________
>R-help at stat.math.ethz.ch mailing list
>https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
--
----------------------------
William Revelle
http://pmc.psych.northwestern.edu/revelle.html
Department of Psychology, Northwestern University
Personality Project: http://personality-project.org/personality.html
More information about the R-help
mailing list