suit: Card suits

Description Usage Arguments Examples

Description

Functions that extract suit symbols and suit colors from a given suit

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
suit_list()

suit_unicode(suit = suit_list(), fill = TRUE)

suit_color(suit = suit_list(), four_color = TRUE)

suit_style(suit, four_color = TRUE)

suit_html(suit = suit_list(), size = 172, four_color = TRUE,
  fill = TRUE)

Arguments

suit

one of the suits listed in list_suits()

fill

whether to use a filled suit symbol like BLACK SPADE SUIT or an unfilled one like WHITE SPADE SUIT

four_color

should a four color deck be applied. This means that each suit will have it's own color (black, red, blue and green). Otherwise, use two colors (black and red).

size

the font-size to use

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# show all valid suits
suit_list()

# determine matching colors for the suit
suit_color("d")
suit_color("d", four_color = FALSE)

# show suits either in the console or as HTML
cat(suit_unicode("c"), "\n")
suit_html("c")
suit_html("c", fill = FALSE)

# iterate over several suits for styling
suit_list() %>% sapply(suit_style) %>% cat("\n")
suit_list() %>% lapply(suit_html) %>% span() %>% browsable()
suit_list() %>% lapply(suit_html, fill = FALSE) %>% span() %>% browsable()

r-webutils/suitr documentation built on Dec. 23, 2021, 12:18 a.m.