repeat_add_columns: repeat_add_columns

View source: R/common.R

repeat_add_columnsR Documentation

repeat_add_columns

Description

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

Usage

repeat_add_columns(x, y)

Arguments

x

Data frame to repeat

y

A copy of x is created for each row of this data frame

Details

This function is used to repeat a table by specified values of a variable, written to a new column as necessary.

Value

A repeated x with columns from y added.

Examples

x <- tibble::tibble(x = 1:3)
y <- tibble::tibble(y = c(4, 5), z = c(6, 7))
repeat_add_columns(x, y)

transportenergy/item_mip_data_processing documentation built on July 6, 2023, 7:51 p.m.