[R] Problem downloading webpages using batchfiles and RCurl from command line in Vista Basic - couldn't connect to host

Tony Breyal tony.breyal at googlemail.com
Tue Jun 2 18:42:47 CEST 2009


Hi Gabor,

Thank you kindly for your response.

Re: Don't need to set PATH -- When I read the batchfiles page, the
opening paragraph says "just place any or all of them anywhere in your
Windows path and you will be able to access them in any Windows
console session". My interpretation of this was that I am suppose to
alter the PATH variable, so that if i create a new batchfile of my
own, then instead of having to write

"C:\...\R-2.8.1\bin\R.exe" CMD BATCH --vanilla --slave "C:\...
\myRScript.R"

I would instead write:

RCMD BATCH --vanilla --slave "C:\...\myRScript.R"

which would refer to the latest version of R, and is therefore a very
nice short hand i think? Other than that, I must admit that I'm not
exactly sure what batchfiles is for, but i have seen it spoken of
quite a bit on this forum and therefore figured that it is the best
way to handle batch jobs. When i look at the webpage, it says that
"[batch]files useful in conjuction with R and R packages on Microsoft
Windows" but not why it's useful, if you see what i mean? The README
has a good first line though "batchfiles contains batch and GUI files
for installing and maintaing R." which is not stated on the webpage
but would be nice if it was.  :-)

Re: Elevated mode -- I did as you advised but unfortunately i ended up
with the same couldn't connect to host error.

Re: running without batchfiles -- I did as you advised and got this as
the path "C:\\PROGRA~1\\R\\R-29~1.0/bin/Rscript.exe" but unfortunately
i ended up with the same couldn't connect to host error.

As this batch process has worked before in Vista Ulitmate, is it
possible that Vista Basic is different enough to stop R batch jobs
from connecting to the internet?

Warm Regards,
Tony


On 2 June, 16:52, Gabor Grothendieck <ggrothendi... at gmail.com> wrote:
> On Tue, Jun 2, 2009 at 7:09 AM, Tony Breyal <tony.bre... at googlemail.com> wrote:
> > Dear all,
>
> > I am having a problem downloading webpages through R when i run it in
> > the DOS window under Windows Vista Basic. I have downloaded the
> > batchfiles fromhttp://code.google.com/p/batchfiles/and have
> > successfully set the PATH.
>
> You don't need to set your PATH if you use batchfiles.  Their
> purpose is avoid having to do that in the first place.    That
> may not be related to your main problem though.
>
>
>
> > I open up 'Command Prompt' in Vista and type (after the C:\...>
> > stuff):
>
> > ### START ###
> > C:\Users\Karen>Rscript -e "library(RCurl); getURL('http://
> >www.google.com')"
> > Loading required package: methods
> > Loading required package: bitops
> > Error in curlPerform(curl = curl, .opts = opts, .encoding
> > = .encoding) :
> >  couldn't connect to host
> > Calls: getURL -> curlPerform -> .Call
> > Execution halted
> > ### END ###
>
> Here are two things to try:
>
> 1. Just a guess but you may need to run this elevated.  Using
> el.js from the batchfiles:
>
> el cmd
>
> and allow it to proceed when asked.  That
> will spawn a new window from which everything will run in
> elevated mode.  Try your Rscript command in that.
>
> 2. Another thing to try is running without using the batchfiles.
> Go into R and enter this:
>  file.path(R.home(), "bin", "Rscript.exe")
>
> and it will give you the path to Rscript.exe.  Using that path
> try this:
>
> "...whatever.../Rscript.exe" -e ...your command...
>
> ______________________________________________
> R-h... at r-project.org mailing listhttps://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.




More information about the R-help mailing list