smunlist: Unlist with name preservation

View source: R/addons.R

smunlistR Documentation

Unlist with name preservation

Description

Collapses list to a named vector with keeping the names as they were in the lowest leaves in a list.

Usage

smunlist(li)

Arguments

li

list

Details

The function works for the lists of multiple levels. These levels can be named, unnamed, or mixture of both. The names of the returned vector are preserved exactly as they were in a lowest leaves of the list, which means that they can be duplicated.

Value

named character vector

Author(s)

Małgorzata Oleś <malgorzata.oles@embl.de>

Examples

mylist = list(A=setNames(1:3, nm=letters[1:3]), B=list(D=3:4, setNames("a", nm=2)))
smunlist(mylist)

MalgorzataOles/BloodCancerMultiOmics2017 documentation built on March 29, 2024, 2:29 p.m.