[R] ReadLines does not give results with urls

Luzie U. Wingen wingen.luzie at mh-hannover.de
Mon Jan 12 18:44:13 CET 2004


OK, that  was the hint I needed:

tcsh> unsetenv no_proxy

did the magic!  Now readLines() works!
The no_proxy variable is empty but present in the normal SuSe system.
Thank you for your help

Luzie


On Mon, Jan 12, 2004 at 05:12:19PM +0000, Prof Brian Ripley wrote:
> It is not readLines() that does not work but url().  Have you tried
> looking at the increased level of output which is available to see why?
> It is described under ?download.file and ?option, option "internet.info".
> 
> We can't tell from your diagnostics if no_proxy is set but empty or unset.
> It does have to be unset and I believe SuSe systems have a habit of having 
> it set but empty.
> 
> 
> On Mon, 12 Jan 2004, Luzie U. Wingen wrote:
> 
> > Hello,
> > 
> > I am using R version 1.8.1 on a linux machine (Suse 8.2.).
> > I have problems to use readLines() with urls.
> > 
> > This seems to be a problem with our proxy-server. 
> > Downloading files work with download.file() with wget but not without:
> > 
> > > download.file(url = "http://cran.r-project.org/src/contrib/PACKAGES", destfile = "test.txt", method = "wget", cacheOK = FALSE)
> > This works!
> > 
> > > download.file(url = "http://cran.r-project.org/src/contrib/PACKAGES", destfile = "test.txt", cacheOK = FALSE)
> > This does not work!
> > 
> > For readLines() there seems not to be the possibility to use wget.
> > So I can only read the local pages which are accessible without proxy-server
> > but not:
> > 
> > > readLines(url("http://cran.r-project.org/src/contrib/PACKAGES"))
> > This does give the following response after 60 sec:
> > >Error in readLines(url("http://cran.r-project.org/src/contrib/PACKAGES"),  : 
> >         cannot open the connection
> > >In addition: Warning message: 
> > >unable to connect to 'cran.r-project.org' on port 80. 
> > 
> > After reading the help pages I checked the http_proxy environmental 
> > variable, which seems to be OK to me:
> > 
> > > Sys.getenv("http_proxy")
> >     http_proxy 
> > 		"http://proxy.mh-hannover.de:8080/" 
> > > Sys.getenv("no_proxy")
> > 		no_proxy 
> >     "" 
> > 
> > Setting the options options(download.file.method="wget") helps
> > for download.file() but not for "readLines().
> > 
> > Does anybody has a further idea, how to manipulate readLines()
> > so that it uses the proxy-server?
> > 
> > Thank you
> > 
> > Luzie
> > 
> 
> -- 
> 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
> 

-- 
Luzie U. Wingen, Institut fuer Zell- und Molekularpathologie,
Medizinische Hochschule Hannover, Carl-Neuberg-Str. 1, 30625 Hannover,
Tel.: (+49) 0511-532-9432, Fax: -4521, Email: wingen.luzie at mh-hannover.de




More information about the R-help mailing list