wpstats {wildpoker} | R Documentation |
Deal Many Hands of a Wild Poker Variant Game
Description
This function deals a large number of hands of poker and captures
the game statistics as observations in a "raw" data frame, then summarizes the
results into a "gstat" list, suitable for graphing with the wpgraphs
function.
Usage
wpstats(ngame, players, wcards = NULL, numdeal = 1000, seed = 52, raw = FALSE)
Arguments
ngame |
This is any supported game, such as "Seven Card Stud" or "Baseball". See
|
players |
An integer value, must be at least 2 and is limited by the number of cards that can be physically dealt. (eg, Seven Card Stud has a max of 7 players) |
wcards |
A vector of string values which are either supported wildcard aliases or individual cards. These cards are in addition to any wildcards that are a natural part of the poker game variant chosen with "ngame". The table below shows the supported aliases and their individual card vector equivalnets:
|
numdeal |
Number of hands to deal, must be positive integer |
seed |
random number seed set at beginning, must be positive integer |
raw |
If TRUE the full "raw" data frame is returned instead of the gstat list |
Details
This program calls the wpgame
function numdeal
times,
generating a raw data frame. This data frame is then consolidated into
a gstat list, whose format depends on ngame
.
Value
if raw is TRUE, returns a rawstat data frame, # of rows = numdeal
[,1] | game | chr | pname parameter |
[,2] | pnum | numeric | players parameter |
[,3] | wild | chr | wcard parameter |
[,4] | mwtype | chr | Winning hand type of Main hand |
[,5] | swtype | chr | Winning hand type of Split hand |
[,6] | mwscore | numeric | score of winning main hand |
[,7] | msscore | numeric | Num players score = winning Main score |
[,8] | mstype | numeric | Num players type = winning Main type |
[,9] | swscore | numeric | score of winning Split hand |
[,10] | ssscore | numeric | Num players score = winning Split score |
[,11] | sstype | numeric | Num players type = winning Split type |
[,12] | mppct | numeric | percent won if Main hand is won |
[,13] | sppct | numeric | percent won if Split hand is won |
[,14] | bppct | numeric | percent won if Both hands are won |
[,15] | wcdeck | numeric | wildcards in deck before the deal |
[,16] | wcdeal | numeric | wildcards in deck after the deal |
if raw is FALSE, returns a gstat list
$game |
a vector of the pname, players and wcards parameters |
$stats |
a vector of the numdeal & seed parameters, and the number of wildcards added to the deck by the wcards parameter |
$pmain |
a table used for graphing win percentage chance of Main hand type by number of players |
$cmain |
a table used for graphing count of winnning Main hand types by number of players |
$wmain |
a table used for graphing count of winning Main hand types by wildcard count |
$psplit |
a table used for graphing win percentage chance of Split hand type by number of players |
$csplit |
a table used for graphing count of winnning Split hand types by number of players |
$wsplit |
a table used for graphing count of winning Split hand types by wildcard count |
$potpct |
a table used for graphing count of percentage of pot won if a hand wins |
Note
This function is intended to allow exposing the raw data behind the pre-calculated results normally used by wpgraphs or to allow running for different random number seeds, number of hands dealt, nonstandard additional wildcards or (when games allow) more than eight players.
It takes about .005 seconds to evaluate each hand - 6 players takes 3 times as long as 2 players, a split hand variant takes twice as long as a variant that has only a main hand. Dealing 1000 rounds of most variants takes a minute or two, but Omaha and Courcheval build hands out of subsets of the player hands, requiring up to 70 separate hand evaluations for each player. This means that 1000 hands of those variants can take a couple of hours to generate.
For this reason, gstat values for all supported game variants have already been calculated for
2-8 players and 0-7 additional wildcards - if interested in any of these standard combinations,
there is no need to call the wpstats
function, wpgraphs
has the required gstat list
already.
Author(s)
Maintainer: Bradley Shanrock-Solberg greblosb@gmail.com
References
poker.com has an excellent reference on game variants which was the primary source for games rules not encountered in my own play.
See Also
Examples
# example of the wpstats run to generate raw statistics
rawstat <- wpstats("Iron Cross Last Wild", 6, "Deuces", numdeal = 10, raw = TRUE)
head(rawstat)
# example of wpstats run to generate a gstat object, used by wpgraphs
wpstats("Seven Stud Hi-Lo", 4, numdeal = 10, seed = 100)