variable of character names into a data frame

Viewed 44

i have a variable containing character names and i want to make each character into a name within a data frame. is there a quick way to do this that is automated as i have different variables with different amounts of characters i want to turn into data frames?

for example

variables with character names

names <- c("one","two","three")

the output i want

dataframe <- data.frame(one = NA, two = NA, three = NA)
dataframe
  one two three
1  NA  NA    NA

thanks

0 Answers
Related