I would like to rename tibble with named vector, even if there is some columns does not exist.
z <- c(x = "a", y = "b", w = "c")
tibble(a = 1:5, b = 2:6) %>%
rename(!!!z)
Error in stop_subscript()
:
! Can't rename columns that don't exist.
x Column c
doesn't exist.
Run rlang::last_error()
to see where the error occurred.