url.exists | R Documentation |
This functions is analogous to file.exists
and determines whether a request for a specific URL responds
without error. We make the request but ask the server
not to return the body. We just process the header.
url.exists(url, ..., .opts = list(...), curl = getCurlHandle(.opts = .opts), .header = FALSE)
url |
a vector of one or more URLs whose existence we are to test |
... |
name = value pairs of Curl options. |
.opts |
a list of name = value pairs of Curl options. |
curl |
a Curl handle that the caller can specify if she wants to reuse an existing handle, e.g. with different options already specified or that has previously established a connection to the Web server |
.header |
a logical value that if |
This makes an HTTP request but with the nobody option set to
FALSE
so that we don't actually retrieve the contents of the URL.
If .header
is FALSE
, this returns
TRUE
or FALSE
for each URL indicating whether
the request was successful (had a status with a value
in the 200 range).
If .header
is TRUE
, the header is returned for the
request for each URL, unless the host could not be resolved. In
the latter case, the header is not meaningful.
Duncan Temple Lang
HTTP specification
curlPerform
url.exists("http://www.omegahat.org/RCurl") try(url.exists("http://www.omegahat.org/RCurl-xxx"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.