In inmemorydatasets package, we can transpose grouped data like this.

```
ds = Dataset(group = repeat(1:3, inner = 2),
                                    b = repeat(1:2, inner = 3),
                                    c = repeat(1:1, inner = 6),
                                    d = repeat(1:6, inner = 1),
                                    e = string.('a':'f'))

```

```
    group   b            c            d            e
  identity  identity    identity    identity    identity
   Int64?   Int64?  Int64?  Int64?  String?
1   1   1   1   1   a
2   1   1   1   2   b
3   2   1   1   3   c
4   2   2   1   4   d
5   3   2   1   5   e
6   3   2   1   6   f

```

```
transpose(groupby(ds, :group), 2:4, id = :e)

```

How can do I do this in DataFrames packages?

How can do I do this in R?

result:

```
group   _variables_ a   b   c   d   e   f
identity    identity    identity    identity    identity    identity    identity    identity
Int64?  String? Int64?  Int64?  Int64?  Int64?  Int64?  Int64?
1   1   b   1   1   missing missing missing missing
2   1   c   1   1   missing missing missing missing
3   1   d   1   2   missing missing missing missing
4   2   b   missing missing 1   2   missing missing
5   2   c   missing missing 1   1   missing missing
6   2   d   missing missing 3   4   missing missing
7   3   b   missing missing missing missing 2   2
8   3   c   missing missing missing missing 1   1
9   3   d   missing missing missing missing 5   6

```

How to do this like above?

```
transpose(groupby(ds, :group), 2:4, id = :e, default = 99999)

```