mergeURI: Combine one URI with respect to a base URI

mergeURIR Documentation

Combine one URI with respect to a base URI

Description

This function allows the caller to combine one URI specification relative to another base URI and expand it. This handles resolving relative links, etc. relative to the URI in which they are defined.

Usage

mergeURI(u, url, reduce = FALSE)

Arguments

u

the (partial) URI of class URI.

url

the base URI (of class URI) relative to which the URI u will be resolved.

reduce

a logical value indicating whether to simplify the path specification to remove the . and .. directory elements.

Value

An object of class URI. See URI.

Author(s)

Duncan Temple Lang <duncan@wald.ucdavis.edu>

See Also

URI

Examples

## Not run: 
  u = URI("http://www.omegahat.org/index.html")

  # Merge at the same top-level of the path
  mergeURI(URI("foo.html"), u)

  u = URI("http://www.omegahat.org/download/R/packages")
  mergeURI(URI("xml"), u)


  u = URI("http://www.omegahat.org/download/R/packages/index.html")
  mergeURI(URI("../xml/index.html"), u)

  # not a relative URI so remains unaltered.
  mergeURI(URI("http://www.ggobi.org/index.html"), u)

## End(Not run)

omegahat/RHTMLForms documentation built on Nov. 29, 2023, 12:36 a.m.