getSetSizesByDegree: Count number of items in each set by degree

Description Usage Arguments Details Value Examples

View source: R/analysis_functions.R

Description

Count number of items in each set by degree of overlap. The degree of overlap is the number of sets of which an item is a member.

Usage

1
getSetSizesByDegree(df, setNames, idName, maxDegree = 4)

Arguments

df

A data frame indicating set membership

setNames

A character vector of set names

idName

A string specifying name of ID variable for each item

maxDegree

A numeric input indicating upper limit on degree

Details

The input data frame should contain a row for each item and a binary variable for each set indicating the membership of each item. The setNames input should correspond to the binary indicator columns in the data frame.

Value

A data frame with variables:

Examples

1
2
3
4
5
6
7
8
9
# Define set names
data("movieSets")
setNames <- setNames <- colnames(movieSets[,-c(1:8)])

# Calculate set sizes
getSetSizesByDegree(movieSets , setNames, "movieId")

# Calculate set sizes with max degree 3
getSetSizesByDegree(movieSets , setNames, "movieId", maxDegree = 3)

natbprice/radsets documentation built on Feb. 29, 2020, 5:21 p.m.