Is there a way to create a dataframe from 2 vectors row wise?
list1<- c('a','b','c')
list2<- c('x','y','z')
I'd like to create a DF from these 2 lists such that each of these 2 lists is a row in the DF.
One option is data.frame
data.frame(x = list1, y = list2)
# x y
#1 a x
#2 b y
#3 c z
Or if it should be otherway, use rbind
setNames(rbind.data.frame(list1, list2), c("x", "y"))
data.frame(rbind(list1, list2))