# NOT RUN {
df <- tibble::tibble(x = c("a", "b"), n = c(1, 2))
uncount(df, n)
uncount(df, n, .id = "id")
# You can also use constants
uncount(df, 2)
# Or expressions
uncount(df, 2 / n)
# }
Run the code above in your browser using DataCamp Workspace