flatten: Flatten a list of length one

Description Usage Arguments Value Examples

Description

Flatten a list of length one to data frame by respecting data types (lists of greater length might not work as expexted)

Usage

1

Arguments

x

list

Value

data.frame of input

Examples

1
2
3
4
5
6
7
8
flatten(list(list(a = 1, b = list(c = "c", d = TRUE)), list(a = 1, b = list(c = "c", d = TRUE))))
flatten(list(a = list(b = list(c = list(d = 1, e = FALSE), g = "tata")) ))
# if there is multi length vector inside the list --> multiple lines
flatten(list(a = list(b = list(c = list(d = 1, e = FALSE), g = "tata"), h = 1:2) ))
# what if no name
flatten(list(1, 2, 3))
# partial names
flatten(list(1, 2, c = 3))

bhakyuz/sahibinden documentation built on June 12, 2019, 2:28 p.m.