Learn R Programming

xml2 (version 1.3.3)

url_absolute: Convert between relative and absolute urls.

Description

Convert between relative and absolute urls.

Usage

url_absolute(x, base)

url_relative(x, base)

Value

A character vector of urls

Arguments

x

A character vector of urls relative to that base

base

A string giving a base url.

See Also

xml_url to retrieve the URL associated with a document

Examples

Run this code
url_absolute(c(".", "..", "/", "/x"), "http://hadley.nz/a/b/c/d")

url_relative("http://hadley.nz/a/c", "http://hadley.nz")
url_relative("http://hadley.nz/a/c", "http://hadley.nz/")
url_relative("http://hadley.nz/a/c", "http://hadley.nz/a/b")
url_relative("http://hadley.nz/a/c", "http://hadley.nz/a/b/")

Run the code above in your browser using DataLab