If I have a vector of strings, how can I easily make them into column headers appended onto a dataframe? I know I could use cbind one-by-one, but is there a way to do it in one pass?
library(dplyr)
my_new_cols <- c("n_a", "n_b", "n_c")
current_data <- tibble(id = c(1:4),
score = c(10, 20, 30, 40))
desired_output <- tibble(id = c(1:4),
score = c(10, 20, 30, 40),
n_a = NA,
n_b = NA,
n_c = NA)
~~~~~