validateBallots validates data format for
It assumes that each row corresponds to a ballot and each column corresponds to a
candidate. If input data is in the correct format,
string: "All tests passed. Please feel free to run
Otherwise, it prints a message corresponding to the formatting error.
validateBallots function should be run before
stv() is called.
Before any calculation,
stv() calls this function and proceeds only
x passes all of the following tests.
x is a
x has unique column names.
x has numeric entries.
x doesn't have any blank columns.
x doesn't have any blank rows.
x doesn't have any rows with non-sequential ranks.
string: "All tests passed. Please feel free to run stv() function." if
passes all tests. Otherwise, a message corresponding to the problem is retunred.
NOTE: Some of the warnings can be fixed using
Other issues must be fixed by the user.
1 2 3
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.