1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/suffix.R
\name{host_extract}
\alias{host_extract}
\title{Extract hosts}
\usage{
host_extract(domains)
}
\arguments{
\item{domains}{a vector of domains, retrieved through \code{\link{url_parse}} or
\code{\link{domain}}.}
}
\value{
a data.frame of two columns: \code{domain}, with the original domain names,
and \code{host}, the identified host from the domain.
}
\description{
\code{host_extract} extracts the host from
a vector of domain names. A host isn't the same as a domain - it could be
the subdomain, if there are one or more subdomains. The host of \code{en.wikipedia.org}
is \code{en}, while the host of \code{wikipedia.org} is \code{wikipedia}.
}
\examples{
# With subdomains
has_subdomain <- domain("https://en.wikipedia.org/wiki/Main_Page")
host_extract(has_subdomain)
# Without
no_subdomain <- domain("https://ironholds.org/projects/r_shiny/")
host_extract(no_subdomain)
}
|