Skip to contents

Extract the suit of a card

Usage

sk_suit_of(x)

Arguments

x

An sk_card object or a character vector of card codes.

Value

A character vector of suit codes ("C", "S", "H", or "D"), the same length as x.

See also

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

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

Examples

sk_suit_of(sk_card("H", "K"))
#> [1] "H"
sk_suit_of(c("CA", "D10"))
#> [1] "C" "D"