add_title | R Documentation |
Gets the title of a URL by accessing the web address online and adds the title as a new column. See details for the meaning of "title". You need an internet connection to run this function.
add_title(wt, lang = "en-US,en-GB,en")
wt |
webtrack data object. |
lang |
character (a language tag). Language accepted by the request.
Defaults to |
The title of a website (the text within the <title>
tag
of a web site's <head>
) #' is the text that is shown on the "tab"
when looking at the website in a browser. It can contain useful information
about a URL's content and can be used, for example, for classification purposes.
Note that it may take a while to run this function for a large number of URLs.
webtrack data.frame with the same columns as wt and a new column
called "title"
, which will be NA
if the title cannot be retrieved.
## Not run:
data("testdt_tracking")
wt <- as.wt_dt(testdt_tracking)[1:2]
# Get titles with `lang` set to default English
wt_titles <- add_title(wt)
# Get titles with `lang` set to German
wt_titles <- add_title(wt, lang = "de")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.