powered by
expanddf(df, count)
df <- expand.grid(a=0:1, b=0:1, c=0:1) df$count <- rpois(nrow(df), 5) ( df2 <- expanddf(df, df$count) )
Run the code above in your browser using DataLab