unlist2: Flatten lists

unlist2R Documentation

Flatten lists

Description

Flatten lists

Usage

unlist2(x, ...)

## S4 method for signature 'DFrameList'
unlist2(x, nameCol = "name", rownameCol = "rowname")

Arguments

x

Object.

nameCol

character(1) or NULL. Column name to assign names of input object.

rownameCol

character(1) or NULL. Column name to assign rownames of input object.

...

Additional arguments.

Details

Intended primarily for complex S4 classes, such as DFrameList. Intentionally does not support recursion.

Value

Unlisted object derived from original input. For example, DFrame derived from DFrameList.

Note

Updated 2024-01-04.

See Also

  • unlist().

Examples

## DFrameList ====
suppressPackageStartupMessages({
    library(IRanges)
})
dfl <- DataFrameList(
    "A" = DataFrame(
        "a" = c(1L, 2L),
        "b" = c(3L, 4L),
        row.names = c("aa", "bb")
    ),
    "B" = DataFrame(
        "a" = 5L,
        "b" = 6L,
        row.names = "cc"
    )
)
## Our variant, which assigns into columns.
x <- unlist2(dfl)
print(x)
## Compare with the standard variant, which modifies rownames.
y <- unlist(dfl)
print(y)

acidgenomics/AcidPlyr documentation built on April 12, 2025, 11:37 a.m.