Repeat a data frame for each entry in a second, binding the columns together.

repeat_add_columns(x, y)

Arguments

x

Data frame (tibble) to repeat

y

A copy of x is created for each row of this tibble

Value

A repeated x with columns from y added.

Details

This corresponds to repeat_and_add_vector in the old data system.

Author

BBL

Examples

x <- tibble::tibble(x = 1:3)
y <- tibble::tibble(y = c(4, 5), z = c(6, 7))
repeat_add_columns(x, y)
#> # A tibble: 6 × 3
#>       x     y     z
#>   <int> <dbl> <dbl>
#> 1     1     4     6
#> 2     1     5     7
#> 3     2     4     6
#> 4     2     5     7
#> 5     3     4     6
#> 6     3     5     7