Re: [R] source and localhost

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Fri, 20 May 2011 16:42:59 +0100 (BST)

On Fri, 20 May 2011, Uwe Ligges wrote:

>
>
> On 20.05.2011 17:22, Thomas.Bock@ptb.de wrote:
>> Dear List,
>>
>> I have problems with the function source() using a
>> url of the kind:
>>
>> http://localhost:5984/path/fn.R
>
> Does
>
> con <- url("http://localhost:5984/path/fn.R")
> source(url)
> close(con)
>
> work for you?
>
> Please read ?source carefully and note it uses a file() connection as the
> default unless you specify another connection explicitly..

Correct, but ?file says

      For ‘file’ the description is a path to the file to be opened or a
      complete URL (when it is the same as calling ‘url’), ...

so this works in principle (and in practice for me: source("http://www.stats.ox.ac.uk/~ripley/APTS2010/slice.R") ). So the issue is something peculiar to the URL. Maybe try download.file on it with options(internet.info=0) to get maximal info.

>
> Uwe Ligges
>
>
>
>
>> I receive
>>
>> Fehler in file(file, "r", encoding = encoding) :
>> kann Verbindung nicht öffnen
>> Zusätzlich: Warnmeldung:
>> In file(file, "r", encoding = encoding) :
>> Öffnen fehlgeschlagen: HTTP Status war '502 cannotconnect'
>>
>> The url itself is ok since I can:
>> - use a browser
>> - use curl
>> - use download.file() function
>> - use getURL() (out of Duncans RCurl)
>>
>> furthermore it works, when I use the full host + domain name.
>> So I think it is about dns stuff. I get a nice:
>>
>>> Sys.getenv("no_proxy")
>> [1] "localhost, 127.0.0.1"
>>
>> and work on 32bit opensuse 11.4 with
>> R version 2.13.0 (2011-04-13)
>>
>> Can someone give me a hint?
>> Best regards
>> Thomas
>>
>> ______________________________________________
>> R-help_at_r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

-- 
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_r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Received on Fri 20 May 2011 - 15:45:12 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 20 May 2011 - 16:40:08 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive