parse_path {webtrackR} | R Documentation |
Parse parts of path for text analysis
Description
parse_path()
parses parts of a path, i.e., anything separated by
"/", "-", "_" or ".", and adds them as a new variable. Parts that do not
consist of letters only, or of a real word, can be filtered via the argument keep
.
Usage
parse_path(wt, varname = "url", keep = "letters_only", decode = TRUE)
Arguments
wt |
webtrack data object |
varname |
character. name of the column from which to extract the host.
Defaults to |
keep |
character. Defines which types of path components to keep.
If set to |
decode |
logical. Whether to decode the path (see |
Value
webtrack data.frame with the same columns as wt
and a new column called 'path_split'
(or, if varname not equal to 'url'
, '<varname>_path_split'
)
containing parts as a comma-separated string.
Examples
## Not run:
data("testdt_tracking")
wt <- as.wt_dt(testdt_tracking)
wt <- parse_path(wt)
## End(Not run)