cards: A Standard Set of Playing Cards

Description Usage Arguments Details Value See Also Examples

Description

The title says it all.

Usage

1
cards(jokers = FALSE, makespace = FALSE)

Arguments

jokers

logical.

makespace

logical.

Details

This generates a data frame sample space of a standard deck of 52 playing cards. Optionally, the user can specify that Jokers be included, which have a rank but with suit a missing value.

Value

A data frame with columns rank and suit, and optionally a column of equally likely probs.

See Also

rolldie, tosscoin, and roulette

Examples

1
2
cards()
cards(makespace = TRUE)

Example output

Loading required package: combinat

Attaching package: 'combinat'

The following object is masked from 'package:utils':

    combn

Loading required package: fAsianOptions
Loading required package: timeDate
Loading required package: timeSeries
Loading required package: fBasics
Loading required package: fOptions

Attaching package: 'prob'

The following objects are masked from 'package:base':

    intersect, setdiff, union

   rank    suit
1     2    Club
2     3    Club
3     4    Club
4     5    Club
5     6    Club
6     7    Club
7     8    Club
8     9    Club
9    10    Club
10    J    Club
11    Q    Club
12    K    Club
13    A    Club
14    2 Diamond
15    3 Diamond
16    4 Diamond
17    5 Diamond
18    6 Diamond
19    7 Diamond
20    8 Diamond
21    9 Diamond
22   10 Diamond
23    J Diamond
24    Q Diamond
25    K Diamond
26    A Diamond
27    2   Heart
28    3   Heart
29    4   Heart
30    5   Heart
31    6   Heart
32    7   Heart
33    8   Heart
34    9   Heart
35   10   Heart
36    J   Heart
37    Q   Heart
38    K   Heart
39    A   Heart
40    2   Spade
41    3   Spade
42    4   Spade
43    5   Spade
44    6   Spade
45    7   Spade
46    8   Spade
47    9   Spade
48   10   Spade
49    J   Spade
50    Q   Spade
51    K   Spade
52    A   Spade
   rank    suit      probs
1     2    Club 0.01923077
2     3    Club 0.01923077
3     4    Club 0.01923077
4     5    Club 0.01923077
5     6    Club 0.01923077
6     7    Club 0.01923077
7     8    Club 0.01923077
8     9    Club 0.01923077
9    10    Club 0.01923077
10    J    Club 0.01923077
11    Q    Club 0.01923077
12    K    Club 0.01923077
13    A    Club 0.01923077
14    2 Diamond 0.01923077
15    3 Diamond 0.01923077
16    4 Diamond 0.01923077
17    5 Diamond 0.01923077
18    6 Diamond 0.01923077
19    7 Diamond 0.01923077
20    8 Diamond 0.01923077
21    9 Diamond 0.01923077
22   10 Diamond 0.01923077
23    J Diamond 0.01923077
24    Q Diamond 0.01923077
25    K Diamond 0.01923077
26    A Diamond 0.01923077
27    2   Heart 0.01923077
28    3   Heart 0.01923077
29    4   Heart 0.01923077
30    5   Heart 0.01923077
31    6   Heart 0.01923077
32    7   Heart 0.01923077
33    8   Heart 0.01923077
34    9   Heart 0.01923077
35   10   Heart 0.01923077
36    J   Heart 0.01923077
37    Q   Heart 0.01923077
38    K   Heart 0.01923077
39    A   Heart 0.01923077
40    2   Spade 0.01923077
41    3   Spade 0.01923077
42    4   Spade 0.01923077
43    5   Spade 0.01923077
44    6   Spade 0.01923077
45    7   Spade 0.01923077
46    8   Spade 0.01923077
47    9   Spade 0.01923077
48   10   Spade 0.01923077
49    J   Spade 0.01923077
50    Q   Spade 0.01923077
51    K   Spade 0.01923077
52    A   Spade 0.01923077

prob documentation built on May 2, 2019, 12:20 p.m.