data <- tibble::tibble(
user = c("A", "A", "A", "B", "B", "C", "C", "C"),
time = c(
"2023-01-01 10:00:00", "2023-01-01 10:05:00",
"2023-01-01 10:20:00", "2023-01-01 12:00:00",
"2023-01-01 12:02:00", "2023-01-01 14:00:00",
"2023-01-01 14:05:00", "2023-01-01 14:10:00"
),
action = c(
"view", "click", "add_cart", "view",
"checkout", "view", "click", "share"
)
)
results <- prepare_data(
data, actor = "user", time = "time", action = "action"
)
print(results$sequence_data)
print(results$meta_data)
print(results$statistics)
data_ordered <- tibble::tibble(
user = c("A", "A", "A", "B", "B", "C", "C", "C"),
order = c(1, 2, 3, 1, 2, 1, 2, 3),
action = c(
"view", "click", "add_cart", "view",
"checkout", "view", "click", "share"
)
)
results_ordered <- prepare_data(
data_ordered, actor = "user", order = "order", action = "action"
)
print(results_ordered$sequence_data)
print(results_ordered$meta_data)
print(results_ordered$statistics)
data_single_session <- tibble::tibble(
action = c(
"view", "click", "add_cart", "view", "checkout", "view", "click", "share"
)
)
results_single <- prepare_data(data_single_session, action = "action")
print(results_single$sequence_data)
print(results_single$meta_data)
print(results_single$statistics)
Run the code above in your browser using DataLab