Skip to contents

Return a standard deck of 52 playing cards, as a data.frame with rank and suit.

Usage

new_deck_df()

Value

a data.frame containing a deck of 52 cards

Details

Uses expand.grid() which creates a data.frame of factors combining ranks and suits.

Examples

new_deck_df()
#>    rank suit
#> 1     2    C
#> 2     3    C
#> 3     4    C
#> 4     5    C
#> 5     6    C
#> 6     7    C
#> 7     8    C
#> 8     9    C
#> 9     T    C
#> 10    J    C
#> 11    Q    C
#> 12    K    C
#> 13    A    C
#> 14    2    D
#> 15    3    D
#> 16    4    D
#> 17    5    D
#> 18    6    D
#> 19    7    D
#> 20    8    D
#> 21    9    D
#> 22    T    D
#> 23    J    D
#> 24    Q    D
#> 25    K    D
#> 26    A    D
#> 27    2    H
#> 28    3    H
#> 29    4    H
#> 30    5    H
#> 31    6    H
#> 32    7    H
#> 33    8    H
#> 34    9    H
#> 35    T    H
#> 36    J    H
#> 37    Q    H
#> 38    K    H
#> 39    A    H
#> 40    2    S
#> 41    3    S
#> 42    4    S
#> 43    5    S
#> 44    6    S
#> 45    7    S
#> 46    8    S
#> 47    9    S
#> 48    T    S
#> 49    J    S
#> 50    Q    S
#> 51    K    S
#> 52    A    S