SciencesPo (version 1.3.8)

domain: Find WWW Domains

Description

Hand function to return the www domain.

Usage

domain(x)

Arguments

x
A vector from which the domain information is desired.

Examples

Run this code
x1 <- "http://stackoverflow.com/questions/19020749/function-to-extract-domain-name-from-url-in-r"
x2 <- "http://www.talkstats.com/"
x3 <- "www.google.com"

domain(x3)

sapply(list(x1, x2, x3), domain)

Run the code above in your browser using DataLab