Re: [R] Test internet presence

2006-09-13 Thread mel
Gregor Gorjanc a écrit : If I summarize the thread there is (currently) no way to test for internet presence with a general approach. what about try(readLines(...)) ? (at least it works fine on Windows.) __ R-help@stat.math.ethz.ch mailing list

Re: [R] Test internet presence

2006-09-12 Thread Ted Harding
On 11-Sep-06 Gregor Gorjanc wrote: Thank you. Your solution is usable but unfortunatelly not portable to Windows. I would like to use this test in package check, which can include also windows OS. Now that I think about it (should have done that earlier), you can use the value of

Re: [R] Test internet presence

2006-09-12 Thread Gregor Gorjanc
Prof Brian Ripley ripley at stats.ox.ac.uk writes: ... Check out tests/internet.R. nsl() checks if you can resolve host names, which has worked well enough there. Thank you prof. Ripley for this pointer. I am posting here the relevant part if someone does not look at SVN. I would just like to

Re: [R] Test internet presence

2006-09-12 Thread Gregor Gorjanc
Gabor Grothendieck wrote: Here is a variation for Windows. The second line returns TRUE or FALSE and may need to be varied if the output of ping is not the same on your system as on mine: ping - system(ping www.google.com, intern = TRUE) as.numeric(strsplit(grep(Received, ping, value =

Re: [R] Test internet presence

2006-09-12 Thread Prof Brian Ripley
On Mon, 11 Sep 2006, Gregor Gorjanc wrote: Prof Brian Ripley ripley at stats.ox.ac.uk writes: ... Check out tests/internet.R. nsl() checks if you can resolve host names, which has worked well enough there. Thank you prof. Ripley for this pointer. I am posting here the relevant part

Re: [R] Test internet presence

2006-09-12 Thread Gregor Gorjanc
Prof Brian Ripley wrote: On Mon, 11 Sep 2006, Gregor Gorjanc wrote: Prof Brian Ripley ripley at stats.ox.ac.uk writes: ... Check out tests/internet.R. nsl() checks if you can resolve host names, which has worked well enough there. Thank you prof. Ripley for this pointer. I am posting here

[R] Test internet presence

2006-09-11 Thread Gregor Gorjanc
Hello useRs! I have a small package and I need internet access for examples. Of course it works fine when I have internet access, but not otherwise. I remember I saw a way to test availability of internet access, but I can not find it now in archives. Can anyone here help me? Thanks! -- Lep

Re: [R] Test internet presence

2006-09-11 Thread Gregor Gorjanc
David Barron wrote: I means non-zero, not non-negative. ... Thanks. download.file() is fine! -- Lep pozdrav / With regards, Gregor Gorjanc -- University of Ljubljana PhD student Biotechnical Faculty Zootechnical

Re: [R] Test internet presence

2006-09-11 Thread David Barron
The function download.file (invisibly) returns a non-negative integer if it fails, so I suppose you could use this as a test. On 11/09/06, Gregor Gorjanc [EMAIL PROTECTED] wrote: Hello useRs! I have a small package and I need internet access for examples. Of course it works fine when I have

Re: [R] Test internet presence

2006-09-11 Thread David Barron
I means non-zero, not non-negative. On 11/09/06, David Barron [EMAIL PROTECTED] wrote: The function download.file (invisibly) returns a non-negative integer if it fails, so I suppose you could use this as a test. On 11/09/06, Gregor Gorjanc [EMAIL PROTECTED] wrote: Hello useRs! I have a

Re: [R] Test internet presence

2006-09-11 Thread Gregor Gorjanc
Gregor Gorjanc wrote: Hello useRs! I have a small package and I need internet access for examples. Of course it works fine when I have internet access, but not otherwise. I remember I saw a way to test availability of internet access, but I can not find it now in archives. Can anyone here

Re: [R] Test internet presence

2006-09-11 Thread Gregor Gorjanc
Gregor Gorjanc wrote: Gregor Gorjanc wrote: Hello useRs! I have a small package and I need internet access for examples. Of course it works fine when I have internet access, but not otherwise. I remember I saw a way to test availability of internet access, but I can not find it now in

Re: [R] Test internet presence

2006-09-11 Thread Ted Harding
On 11-Sep-06 Gregor Gorjanc wrote: It seems that 'internal' method was used (I use R 2.3.1 under Linux) as indicated in help page of download.file. I could use wget or lynx methods, but these two must be available, so this is not really portable. Are there any other options for testing

Re: [R] Test internet presence

2006-09-11 Thread Prof Brian Ripley
On Mon, 11 Sep 2006, [EMAIL PROTECTED] wrote: On 11-Sep-06 Gregor Gorjanc wrote: It seems that 'internal' method was used (I use R 2.3.1 under Linux) as indicated in help page of download.file. I could use wget or lynx methods, but these two must be available, so this is not really

Re: [R] Test internet presence

2006-09-11 Thread Ted Harding
[Sorry -- errors due to mistyping especially at below. Corrected in the following lines.] On 11-Sep-06 Ted Harding wrote: On 11-Sep-06 Gregor Gorjanc wrote: It seems that 'internal' method was used (I use R 2.3.1 under Linux) as indicated in help page of download.file. I could use wget or

Re: [R] Test internet presence

2006-09-11 Thread Gregor Gorjanc
Thank you. Your solution is usable but unfortunatelly not portable to Windows. I would like to use this test in package check, which can include also windows OS. On 11-Sep-06 Ted Harding wrote: On 11-Sep-06 Gregor Gorjanc wrote: It seems that 'internal' method was used (I use R 2.3.1 under

Re: [R] Test internet presence

2006-09-11 Thread Gabor Grothendieck
Here is a variation for Windows. The second line returns TRUE or FALSE and may need to be varied if the output of ping is not the same on your system as on mine: ping - system(ping www.google.com, intern = TRUE) as.numeric(strsplit(grep(Received, ping, value = TRUE), [ ,])[[1]][8]) 0 On