Learn R Programming

webtrackR (version 0.1.0)

audience_incidence: Create incidence matrix for two-mode networks including audiences

Description

audience_incidence() created an incidence matrix, which is a matrix A with entries A[i,j]=1 if panelist i visited web site j at least once. Web site can be defined, for example, by the URL's domain, or its host.

Usage

audience_incidence(wt, mode2 = "domain", cutoff = 3)

Value

Incidence matrix of a two-mode network

Arguments

wt

webtrack data object.

mode2

character. Name of column that includes the second mode (e.g., domain or host)

cutoff

visits below this cutoff will not be considered as a visit.

See Also

To create audience networks see audience_network.

Examples

Run this code
if (FALSE) {
data("testdt_tracking")
wt <- as.wt_dt(testdt_tracking)
wt <- add_duration(wt)
wt <- suppressWarnings(extract_domain(wt))
# create incidence matrix using domains as second mode
incidence <- audience_incidence(wt)
# create incidence matrix using hosts as second mode
wt <- suppressWarnings(extract_host(wt))
incidence <- audience_incidence(wt, mode2 = "host")
}

Run the code above in your browser using DataLab