Learn R Programming

cryptoQuotes (version 1.3.0)

flatten: flatten nested lists

Description

[Stable]

Flatten a nested list, regardless of its level of nesting.

Usage

flatten(x)

Value

An unnested list

Arguments

x

A list

See Also

Other development tools: GET(), convert_date(), default_dates(), fetch(), is.date()

Examples

Run this code
# script: flattten
# date: 2024-03-03
# author: Serkan Korkmaz, serkor1@duck.com
# objective: Give an example
# of the flatten-function
# script start;

# 1) create a nested list
nested_list <- list(
  a = 1,
  b = list(
    c = 2,
    d = 3
  )
)

# 2) flatten the
# nested list
cryptoQuotes:::flatten(
  nested_list
)


# script end;

Run the code above in your browser using DataLab