Re: [R] check whether connection can be opened

2012-07-19 Thread Berry Boessenkool
ww...";), silent=T ) if(!class(internet)=="try-error") { # take subset and write into file } else { cat("connection not successfull\n") } > CC: r-help@r-project.org > From: michael.weyla...@gmail.com > Subject: Re: [R] check whether connection c

Re: [R] check whether connection can be opened

2012-07-18 Thread Michael Weylandt
I think you'll need to roll your own using tryCatch() around open(). Michael On Jul 18, 2012, at 5:09 AM, Berry Boessenkool wrote: > > > Hi all, > > I'm working on a function that reads online data that is only available to > certain IPs. It then writes a subset of the data into a file. >

[R] check whether connection can be opened

2012-07-18 Thread Berry Boessenkool
Hi all, I'm working on a function that reads online data that is only available to certain IPs. It then writes a subset of the data into a file. So whenever I'm logged in elsewhere or am not connected to the internet, I get an error, and the function is terminated. I want it to rather print a