getSetSizes: Count total number of items in each set

Description Usage Arguments Details Value Examples

View source: R/analysis_functions.R

Description

Count total number of items in each set

Usage

1

Arguments

df

A data frame indicating set membership

setNames

A character vector of set names

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 set and N indicating the number of items in each set

Examples

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

# Calculate set sizes
getSetSizes(movieSets, setNames)

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