Learn R Programming

urlexplorer (version 0.1.0)

split_host: Split host into subdomains and domain

Description

Split host into subdomains and domain

Usage

split_host(host)

Value

A tibble with one row per hostname and columns for top-level domain, domain and subdomains. Columns are created as many as the number of hosts' components and are named as tld, domain, subdomain_1, subdomain_2, etc.

Arguments

host

A character vector of hostnames to be split.

Examples

Run this code
split_host(c("subdomain.example.com"))
split_host(c("subdomain2.subdomain1.example.com", "example.com"))

Run the code above in your browser using DataLab