profile_of_rankings | R Documentation |
'profile_of_rankings()' creates a profile of rankings. These profile of rankings will be useful for all the functions implementing ranking rules
# PROFILE OF RANKINGS:
ranking – numberOfVoters – candidate1 – candidate2 ...
1 .. rankingpos rankingpos ...
2 .. rankingpos rankingpos ...
profile_of_rankings( matrix = NULL, numberOfVoters = NULL, candidates = NULL, ties = NULL )
matrix |
matrix where each row reperesents a ranking or vector where the candidates for each ranking are listed row by row |
numberOfVoters |
the number of voters for each row |
candidates |
the names of the candidates |
ties |
boolean vector for representing ties when we are using indexes for the matrix with the ranking |
A dataframe containing all the data needed to work with a profile of rankings
# Create a profile of rankings (recommended way) profileOfRankings <- profile.of.rankings(candidates = c('a','b','c','d')) profileOfRankings <- add.ranking(profileOfRankings, c('c','b','a','d'), votes = 6) profileOfRankings <- add.ranking(profileOfRankings, c('a','d','b','c'), votes = 5) profileOfRankings <- add.ranking(profileOfRankings, c('b','a','d','c'), votes = 3)
# Using the first parameter as vector profileOfRankings <- profile.of.rankings( c('a','b','c','d', 'a','d','b','c', 'd','a','c','b'), candidates = c('a','b','c','d'))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.