filter_superior: Remove rows from table for which superior coalitions are...

filter_superiorR Documentation

Remove rows from table for which superior coalitions are possible

Description

Given a table with simulations in the rows and coalitions in the columns, this function returns the coalition probabilities for a specified coalition, by default excluding superior coalitions first

Usage

filter_superior(majority_df, coalition, ...)

Arguments

majority_df

A data frame containing logical values indicating if the coalitions (columns) have a majority (rows).

coalition

The coalition of interest for which superior coalitions will be obtained by get_superior.

...

Further arguments passed to get_superior

See Also

get_superior

Examples

test_df <- data.frame(
 cdu            = c(rep(FALSE, 9), TRUE),
 cdu_fdp        = c(rep(FALSE, 8), TRUE, TRUE),
 cdu_fdp_greens = c(TRUE, TRUE, rep(FALSE, 6), TRUE, TRUE))
calculate_prob(test_df, "cdu_fdp_greens") # exclude_superior defaults to TRUE
calculate_prob(test_df, "cdu_fdp_greens", exclude_superior=FALSE)

coalitions documentation built on Aug. 17, 2022, 5:07 p.m.