Learn R Programming

webtrackR (version 0.1.0)

extract_path: Extract the path from URL

Description

extract_path() adds the path of a URL as a new column. The path is defined as the part following the host but not including a query (anything after a "?") or a fragment (anything after a "#").

Usage

extract_path(wt, varname = "url")

Value

webtrack data.table with the same columns as wt and a new column called 'path' (or, if varname not equal to 'url', '<varname>_path')

Arguments

wt

webtrack data object

varname

character. name of the column from which to extract the host. Defaults to "url".

Examples

Run this code
if (FALSE) {
data("testdt_tracking")
wt <- as.wt_dt(testdt_tracking)
# Extract path
wt <- extract_path(wt)
}

Run the code above in your browser using DataLab