Skip to contents

Evaluate the rank category of a five card poker hand.

Usage

eval_hand_df(h)

Arguments

h

a data.frame of 5 cards.

Value

string hand rank

Details

Uses order() and rle() to identify flushes, straights, pairs, three, and four of a kind.

Examples

deck <- new_deck_df()
(hand <- deal_hand_df(deck))
#>    rank suit
#> 13    A    C
#> 2     3    C
#> 43    5    S
#> 50    Q    S
#> 5     6    C
eval_hand_df(hand)
#> [1] "high_card"