add_previous_visit {webtrackR} | R Documentation |
Add the previous visit as a new column
Description
add_previous_visit()
adds the previous visit, as determined by order of
timestamps as a new column The previous visit can be added as either the full URL,
the extracted host or the extracted domain, depending on level
.
Usage
add_previous_visit(wt, level = "url")
Arguments
wt |
webtrack data object. |
level |
character. Either |
Value
webtrack data.frame with the same columns as wt and
a new column called url_previous
,host_previous
or domain_previous.
.
Examples
## Not run:
data("testdt_tracking")
wt <- as.wt_dt(testdt_tracking)
# Adding previous full URL as new column
wt <- add_previous_visit(wt, level = "url")
# Adding previous host as new column
wt <- add_previous_visit(wt, level = "host")
# Adding previous domain as new column
wt <- add_previous_visit(wt, level = "domain")
## End(Not run)
[Package webtrackR version 0.3.1 Index]