Returns a data frame repeated by row n time.

rep_df(df, n)

Arguments

df

A data frame.

n

The number of times to repeat the data frame by row.

Examples

df <- data.frame(
  one = c(1, 2),
  two = c(3, 4),
  three = c(5, 6)
)

rep_df(df, 3)
#>   one two three
#> 1   1   3     5
#> 2   2   4     6
#> 3   1   3     5
#> 4   2   4     6
#> 5   1   3     5
#> 6   2   4     6