William Revelle
2004-May-10 16:28 UTC
[R] problem with loadURL -- claims newer version used
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 formatError: 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 -- ---------------------------- William Revelle http://pmc.psych.northwestern.edu/revelle.html Department of Psychology, Northwestern University Personality Project: http://personality-project.org/personality.html
Prof Brian Ripley
2004-May-10 17:20 UTC
[R] problem with loadURL -- claims newer version used
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. 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. 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