listCol_w: Flatten a Column Stored as a List

Description Usage Arguments Value Author(s) See Also Examples

Description

Flattens a column stored as a list into a wide form.

Usage

1
listCol_w(inDT, listcol, drop = TRUE, fill = NA_character_)

Arguments

inDT

The input dataset.

listcol

The name of the column stored as a list.

drop

Logical. Should the original column be dropped? Defaults to TRUE.

fill

The desired fill value. Defaults to NA_character_.

Value

A data.table.

Author(s)

Ananda Mahto

See Also

listCol_l to unlist a list column into a "long" format.

Examples

1
2
dat <- data.frame(A = 1:3, B = I(list(c(1, 2), c(1, 3, 5), c(4))))
listCol_w(dat, "B")

mrdwab/splitstackshape documentation built on May 23, 2019, 7:16 a.m.