session_count: Count the number of sessions in a sessionised dataset

View source: R/metrics.R

session_countR Documentation

Count the number of sessions in a sessionised dataset

Description

link{session_count} counts the number of sessions in a sessionised dataset, producing either a count for the overall dataset or on a per-user basis (see below).

Usage

session_count(sessions, user_id = NULL)

Arguments

sessions

a dataset of sessions, presumably generated by sessionise

user_id

the column of sessions containing user IDs. If NULL (the default), a single count of sessions for the entire dataset will be generated. Otherwise, a data.frame of user IDs and the session count for each user ID will be returned.

Value

either a single integer value or a data.frame (see above).

Examples

#Load and sessionise the dataset
data("session_dataset")
sessions <- sessionise(session_dataset, timestamp, uuid)

# Calculate overall bounce rate
count <- session_count(sessions)

# Calculate session count on a per-user basis
per_user <- session_count(sessions, user_id = uuid)


reconstructr documentation built on March 18, 2022, 7:05 p.m.