Skip to contents

Extract the rank of a card

Usage

sk_rank_of(x)

Arguments

x

An sk_card object or a character vector of card codes.

Value

A character vector of rank codes, the same length as x. The ten is two characters wide ("10"); every other rank is one.

See also

sk_suit_of() for the other half of a card code.

Other card functions: format.sk_card(), sk_card(), sk_full_deck(), sk_points(), sk_suit_of()

Examples

sk_rank_of(sk_card("H", "K"))
#> [1] "K"
sk_rank_of(c("CA", "D10"))
#> [1] "A"  "10"