From murdoch.duncan at gmail.com  Mon Dec 13 18:50:32 2010
From: murdoch.duncan at gmail.com (Duncan Murdoch)
Date: Mon, 13 Dec 2010 12:50:32 -0500
Subject: [Rd] errors in getconnection or scan
In-Reply-To: <AANLkTim7MRasN2+SuSThq-mszf4w7isYim1LBTVxVLgf@mail.gmail.com>
References: <AANLkTim7MRasN2+SuSThq-mszf4w7isYim1LBTVxVLgf@mail.gmail.com>
Message-ID: <4D065CE8.6030302@gmail.com>

On 13/12/2010 12:36 PM, Arthur Charpentier wrote:
> I was wondering if there was a function like "does connection exists" ?

See ?showConnections.

> I am currently using loops to build up a database, and I have either
>
>>   B = getConnection(localization)
> Error in getConnection(localization) : there is no connection -2147483648
> In addition: Warning message:
> In getConnection(localization) : NAs introduced by coercion

Where did the localization variable come from?  getConnection is pretty 
rarely used.

>
> or
>
>>   B = scan(localization)
> Error in file(file, "r") : cannot open the connection
> In addition: Warning message:
> In file(file, "r") : cannot open: HTTP status was '404 Not Found'
>
> is there a way to test where localization is an html page, or not ? and to
> say that if localization does exist, then scan it ?

What's your definition of an html page?  Testing for valid html is hard.

Duncan Murdoch



[Rd] errors in getconnection or scan
Duncan Murdoch