Replicate rows of a data frame
replicateRows.Rd
Replicates the rows of a data frame by a specified factor.
Examples
df <- data.frame(a = 1:3, b = letters[1:3])
replicateRows(df, 2)
#> a b
#> 1 1 a
#> 2 1 a
#> 3 2 b
#> 4 2 b
#> 5 3 c
#> 6 3 c
replicateRows.Rd
Replicates the rows of a data frame by a specified factor.
df <- data.frame(a = 1:3, b = letters[1:3])
replicateRows(df, 2)
#> a b
#> 1 1 a
#> 2 1 a
#> 3 2 b
#> 4 2 b
#> 5 3 c
#> 6 3 c