File: tld_extract.Rd

package info (click to toggle)
r-cran-urltools 1.7.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 512 kB
  • sloc: cpp: 1,234; ansic: 303; sh: 13; makefile: 2
file content (39 lines) | stat: -rw-r--r-- 1,266 bytes parent folder | download | duplicates (2)
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
32
33
34
35
36
37
38
39
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/suffix.R
\name{tld_extract}
\alias{tld_extract}
\title{Extract TLDs}
\usage{
tld_extract(domains, tlds = NULL)
}
\arguments{
\item{domains}{a vector of domains, retrieved through \code{\link{url_parse}} or
\code{\link{domain}}.}

\item{tlds}{a dataset of TLDs. If NULL (the default), \code{tld_extract} relies
on urltools' \code{\link{tld_dataset}}; otherwise, you can pass in the result of
\code{\link{tld_refresh}}.}
}
\value{
a data.frame of two columns: \code{domain}, with the original domain names,
and \code{tld}, the identified TLD from the domain.
}
\description{
\code{tld_extract} extracts the top-level domain (TLD) from
a vector of domain names. This is distinct from the suffixes, extracted with
\code{\link{suffix_extract}}; TLDs are \emph{top} level, while suffixes are just
domains through which internet users can publicly register domains (the difference
between \code{.org.uk} and \code{.uk}).
}
\examples{
# Using the inbuilt dataset
domains <- domain("https://en.wikipedia.org/wiki/Main_Page")
tld_extract(domains)

# Using a refreshed one
tld_extract(domains, tld_refresh())

}
\seealso{
\code{\link{suffix_extract}} for retrieving suffixes (distinct from TLDs).
}