Skip to contents

Determines whether each card in a card vector is a face card (J, Q, or K).

Usage

is_face_card(x)

Arguments

x

A card vector created using card().

Value

A logical vector: TRUE for face cards, FALSE otherwise.

Details

Returns a logical vector indicating whether each card is a face card. Non-card inputs will throw an error.

Examples

cards <- card(c("J", "5", "Q"), c("♣", "♦", "♥"))
is_face_card(cards)  # TRUE FALSE TRUE
#> [1]  TRUE FALSE  TRUE