| validateBallots {STV} | R Documentation | 
Validates Input Data Format for stv().
Description
The function validateBallots validates data format for stv() input.  
It assumes that each row corresponds to a ballot and each column corresponds to a 
candidate. If input data is in the correct format, validateBallots returns 
string: "All tests passed. Please feel free to run stv() function." 
Otherwise, it prints a message corresponding to the formatting error.
Usage
validateBallots(x)
Arguments
| x | a  | 
Details
The validateBallots function should be run before stv() is called. 
Before any calculation, stv() calls this function and proceeds only 
if x passes all of the following tests.
- If - xis a- data.frame.
- If - xhas unique column names.
- If - xhas numeric entries.
- If - xdoesn't have any blank columns.
- If - xdoesn't have any blank rows.
- If - xdoesn't have any rows with non-sequential ranks.
Value
string: "All tests passed. Please feel free to run stv() function." if x
passes all tests. Otherwise, a message corresponding to the problem is retunred. 
NOTE: Some of the warnings can be fixed using cleanBallots() function. 
Other issues must be fixed by the user.
Examples
data(ballots)
result <- try(validateBallots(ballots), silent=TRUE)
print(result)