Learn R Programming

webtrackR (version 0.1.0)

sum_activity: Summarize activity per person

Description

sum_activity() counts the number of active time periods (i.e., days, weeks, months, years, or waves) by panelist_id. A period counts as "active" if the panelist provided at least one visit for that period.

Usage

sum_activity(wt, timeframe = "date")

Value

a data.table with columns panelist_id, column indicating the number of active time units.

Arguments

wt

webtrack data object.

timeframe

character. Indicates for what time frame to aggregate visits. Possible values are "date", "week", "month", "year" or "wave". If set to "wave", wt must contain a column call wave. Defaults to "date".

Examples

Run this code
if (FALSE) {
data("testdt_tracking")
wt <- as.wt_dt(testdt_tracking)
# summarize activity by day
wt_sum <- sum_activity(wt, timeframe = "date")
}

Run the code above in your browser using DataLab