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
#> 34    9    H
#> 6     7    C
#> 4     5    C
#> 48    T    S
#> 52    A    S
eval_hand_df(hand)
#> [1] "high_card"