Description Usage Value Author(s) See Also Examples
View source: R/ParameterChecks_CoopGame.R
Returns a defined data structure which is intended to store an error code and a message after the check of function parameters was executed. In case parameter check was successfull the error code has the value '0' and the message is 'NULL'.
1 |
list with 2 elements named errCode which contains an integer representing the error code ('0' if no error) and errMessage for the error message ('NULL' if no error)
Johannes Anwander anwander.johannes@gmail.com
Other ParameterChecks_CoopGame:
stopOnInconsistentEstateAndClaimsVector(),
stopOnInvalidAllocation(),
stopOnInvalidBoolean(),
stopOnInvalidClaimsVector(),
stopOnInvalidCoalitionS(),
stopOnInvalidDictator(),
stopOnInvalidEstate(),
stopOnInvalidGameVector(),
stopOnInvalidGrandCoalitionN(),
stopOnInvalidIndex(),
stopOnInvalidLeftRightGloveGame(),
stopOnInvalidNChooseB(),
stopOnInvalidNumberOfPlayers(),
stopOnInvalidNumber(),
stopOnInvalidQuota(),
stopOnInvalidVetoPlayer(),
stopOnInvalidWeightVector(),
stopOnParamCheckError()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | library(CoopGame)
initParamCheck_example=function(numberOfPlayers){
paramCheckResult=getEmptyParamCheckResult()
if(numberOfPlayers!=3){
paramCheckResult$errMessage="The number of players is not 3 as expected"
paramCheckResult$errCode=1
}
return(paramCheckResult)
}
initParamCheck_example(3)
#Output:
#$errCode
#[1] 0
#$errMessage
#NULL
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.