Free Access Week - Data Engineering + BI
Data Engineering and BI courses are free this week!
Free Access Week - Jun 2-8

webtrackR (version 0.1.0)

add_previous_visit: 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")

Value

webtrack data.table with the same columns as wt and a new column called url_previous,host_previous or domain_previous..

Arguments

wt

webtrack data object.

level

character. Either "url", "host" or "domain". Defaults to "url".

Examples

Run this code
if (FALSE) {
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")
}

Run the code above in your browser using DataLab