list2df: trans list into data.frame

View source: R/dataframe.R

list2dfR Documentation

trans list into data.frame

Description

trans list into data.frame

Usage

list2df(x, rownames = TRUE, colnames = NULL, method = "row")

Arguments

x

list

rownames

use rownames or not

colnames

colnames of the output

method

one of ⁠row, col⁠, set each item as row or col, default as row

Value

tibble

Examples

x <- list(
  c("a", "1"),
  c("b", "2"),
  c("c", "3")
)

list2df(x, colnames = c("char", "num"))

x <- list(
  c("a", "b", "c"),
  c("1", "2", "3")
)

list2df(x, method = "col")

baizer documentation built on Oct. 19, 2023, 9:07 a.m.