cbind column names based on value code example
Example 1: cbind column names based on value
library(dplyr)
test_data %>%
mutate(!! y_attribute := NA)
# col1 Survived
#1 1 NA
#2 2 NA
#3 3 NA
#4 4 NA
#5 5 NA
Example 2: cbind with column names
colnames(merger)[1]<-"Date"
Example 3: cbind with column names
colnames(merger)[,1]<-"Date"