Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

uncount..html

Uncount a data.table


Description

Uncount a data.table

Usage

uncount.(.df, weights, .remove = TRUE, .id = NULL)

Arguments

.df

A data.frame or data.table

weights

A column containing the weights to uncount by

.remove

If TRUE removes the selected weights column

.id

A string name for a new column containing a unique identifier for the newly uncounted rows.

Examples

df <- data.table(x = c("a", "b"), n = c(1, 2))

uncount.(df, n)

uncount.(df, n, .id = "id")

tidytable

Tidy Interface to 'data.table'

v0.6.1
MIT + file LICENSE
Authors
Mark Fairbanks [aut, cre], Abdessabour Moutik [ctb], Matt Carlson [ctb], Ivan Leung [ctb], Ross Kennedy [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.