I have a data.frame df and I want that every row in this df is duplicated lengthTime times and that a new column is added that counts
df
lengthTime
Quick update
There is now also the crossing() function in package tidyr which can be used instead of merge, is somewhat faster, and returns a tbl_df / tibble.
data.frame(time=1:10) %>% merge(iris, by=NULL) data.frame(time=1:10) %>% tidyr::crossing(iris)