library(tidyverse)
insert_df <- tibble(
arena = as.character("PBO"),
home = as.character("NA"),
visitor = as.character("PBO")
)
games <- tibble(
arena = c("NB", "SBY", "OSH"),
home = c("NB", "SBY", "OSH"),
visitor = c("PBO", "PBO", "PBO")
)
I would like to get the result as shown below. I have tried spliting the games tibble into a list and add_row() to no avail. Thanks.
output <- tibble(
arena = c("PBO", "NB", "PBO", "PBO", "SBY", "PBO", "PBO", "OSH", "PBO"),
home = c("NA", "NB", "NA", "NA", "SBY", "NA", "NA", "OSH", "NA"),
visitor = c("PBO", "PBO", "PBO", "PBO", "PBO", "PBO", "PBO", "PBO", "PBO")
)