R/dataframe.R
list2df.Rd
trans list into data.frame
list2df(x, rownames = TRUE, colnames = NULL, method = "row")
list
use rownames or not
colnames of the output
one of row, col, set each item as row or col, default as row
row, col
tibble
x <- list( c("a", "1"), c("b", "2"), c("c", "3") ) list2df(x, colnames = c("char", "num")) #> char num #> It1 a 1 #> It2 b 2 #> It3 c 3 x <- list( c("a", "b", "c"), c("1", "2", "3") ) list2df(x, method = "col") #> It1 It2 #> 1 a 1 #> 2 b 2 #> 3 c 3