R: Create empty tibble/data frame with column names coming from a vector
问题 I would like to create an empty data frame where the column names are coming from a character vector. for example, if this was my vector: vec <- letters[1:3] I would like create an empty data frame like the following: df <- tibble('a' = character(), 'b' = character(), 'c' = character()) however, I would like to iterate through the items in the vector to populate the dataframe names and not have to manually specify each one. In reality my vector has 40+ names. I've tried the following by they