allcombinations() --- R の expand.grid()

与えられた引数の値のすべての組み合わせから DataFrame を作る。
R の expand.grid() に相当するもの。

DataFrames の中に，allcombinations() がある。
DataFrames が v1.5.0 以上でないと存在しない。

allcombinations(DataFrame; kwargs...)
allcombinations(DataFrame, pairs::Pair...)

第1引数は DataFrame
第2引数以降は kwargs... すなわち，`列名 = ベクトル` または pairs::Pair... すなわち `"列名"=> ベクトル`の指定（いずれか一方に統一すること）を繰り返す。

## 使用例 kwargs... を使う

```julia
using DataFrames

df = allcombinations(DataFrame,
    letters = [:a, :b, :c], numbers = [1,2,3], other = ["male", "female"])
```




<div><div style = "float: left;"><span>18×3 DataFrame</span></div><div style = "clear: both;"></div></div><div class = "data-frame" style = "overflow-x: scroll;"><table class = "data-frame" style = "margin-bottom: 6px;"><thead><tr class = "header"><th class = "rowNumber" style = "font-weight: bold; text-align: right;">Row</th><th style = "text-align: left;">letters</th><th style = "text-align: left;">numbers</th><th style = "text-align: left;">other</th></tr><tr class = "subheader headerLastRow"><th class = "rowNumber" style = "font-weight: bold; text-align: right;"></th><th title = "Symbol" style = "text-align: left;">Symbol</th><th title = "Int64" style = "text-align: left;">Int64</th><th title = "String" style = "text-align: left;">String</th></tr></thead><tbody><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">1</td><td style = "text-align: left;">a</td><td style = "text-align: right;">1</td><td style = "text-align: left;">male</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">2</td><td style = "text-align: left;">b</td><td style = "text-align: right;">1</td><td style = "text-align: left;">male</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">3</td><td style = "text-align: left;">c</td><td style = "text-align: right;">1</td><td style = "text-align: left;">male</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">4</td><td style = "text-align: left;">a</td><td style = "text-align: right;">2</td><td style = "text-align: left;">male</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">5</td><td style = "text-align: left;">b</td><td style = "text-align: right;">2</td><td style = "text-align: left;">male</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">6</td><td style = "text-align: left;">c</td><td style = "text-align: right;">2</td><td style = "text-align: left;">male</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">7</td><td style = "text-align: left;">a</td><td style = "text-align: right;">3</td><td style = "text-align: left;">male</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">8</td><td style = "text-align: left;">b</td><td style = "text-align: right;">3</td><td style = "text-align: left;">male</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">9</td><td style = "text-align: left;">c</td><td style = "text-align: right;">3</td><td style = "text-align: left;">male</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">10</td><td style = "text-align: left;">a</td><td style = "text-align: right;">1</td><td style = "text-align: left;">female</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">11</td><td style = "text-align: left;">b</td><td style = "text-align: right;">1</td><td style = "text-align: left;">female</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">12</td><td style = "text-align: left;">c</td><td style = "text-align: right;">1</td><td style = "text-align: left;">female</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">13</td><td style = "text-align: left;">a</td><td style = "text-align: right;">2</td><td style = "text-align: left;">female</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">14</td><td style = "text-align: left;">b</td><td style = "text-align: right;">2</td><td style = "text-align: left;">female</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">15</td><td style = "text-align: left;">c</td><td style = "text-align: right;">2</td><td style = "text-align: left;">female</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">16</td><td style = "text-align: left;">a</td><td style = "text-align: right;">3</td><td style = "text-align: left;">female</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">17</td><td style = "text-align: left;">b</td><td style = "text-align: right;">3</td><td style = "text-align: left;">female</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">18</td><td style = "text-align: left;">c</td><td style = "text-align: right;">3</td><td style = "text-align: left;">female</td></tr></tbody></table></div>


## 使用例 pairs::Pair... を使う

同じことを別の指定法で


```julia
df = allcombinations(DataFrame,
    "letters" => [:a, :b, :c], "numbers" => [1,2,3], "other" => ["male", "female"])
```




<div><div style = "float: left;"><span>18×3 DataFrame</span></div><div style = "clear: both;"></div></div><div class = "data-frame" style = "overflow-x: scroll;"><table class = "data-frame" style = "margin-bottom: 6px;"><thead><tr class = "header"><th class = "rowNumber" style = "font-weight: bold; text-align: right;">Row</th><th style = "text-align: left;">letters</th><th style = "text-align: left;">numbers</th><th style = "text-align: left;">other</th></tr><tr class = "subheader headerLastRow"><th class = "rowNumber" style = "font-weight: bold; text-align: right;"></th><th title = "Symbol" style = "text-align: left;">Symbol</th><th title = "Int64" style = "text-align: left;">Int64</th><th title = "String" style = "text-align: left;">String</th></tr></thead><tbody><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">1</td><td style = "text-align: left;">a</td><td style = "text-align: right;">1</td><td style = "text-align: left;">male</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">2</td><td style = "text-align: left;">b</td><td style = "text-align: right;">1</td><td style = "text-align: left;">male</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">3</td><td style = "text-align: left;">c</td><td style = "text-align: right;">1</td><td style = "text-align: left;">male</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">4</td><td style = "text-align: left;">a</td><td style = "text-align: right;">2</td><td style = "text-align: left;">male</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">5</td><td style = "text-align: left;">b</td><td style = "text-align: right;">2</td><td style = "text-align: left;">male</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">6</td><td style = "text-align: left;">c</td><td style = "text-align: right;">2</td><td style = "text-align: left;">male</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">7</td><td style = "text-align: left;">a</td><td style = "text-align: right;">3</td><td style = "text-align: left;">male</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">8</td><td style = "text-align: left;">b</td><td style = "text-align: right;">3</td><td style = "text-align: left;">male</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">9</td><td style = "text-align: left;">c</td><td style = "text-align: right;">3</td><td style = "text-align: left;">male</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">10</td><td style = "text-align: left;">a</td><td style = "text-align: right;">1</td><td style = "text-align: left;">female</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">11</td><td style = "text-align: left;">b</td><td style = "text-align: right;">1</td><td style = "text-align: left;">female</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">12</td><td style = "text-align: left;">c</td><td style = "text-align: right;">1</td><td style = "text-align: left;">female</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">13</td><td style = "text-align: left;">a</td><td style = "text-align: right;">2</td><td style = "text-align: left;">female</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">14</td><td style = "text-align: left;">b</td><td style = "text-align: right;">2</td><td style = "text-align: left;">female</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">15</td><td style = "text-align: left;">c</td><td style = "text-align: right;">2</td><td style = "text-align: left;">female</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">16</td><td style = "text-align: left;">a</td><td style = "text-align: right;">3</td><td style = "text-align: left;">female</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">17</td><td style = "text-align: left;">b</td><td style = "text-align: right;">3</td><td style = "text-align: left;">female</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">18</td><td style = "text-align: left;">c</td><td style = "text-align: right;">3</td><td style = "text-align: left;">female</td></tr></tbody></table></div>