[226bc8]: / man / smunlist.Rd

Download this file

32 lines (31 with data), 714 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
\name{smunlist}
\alias{smunlist}
\title{
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{
\item{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{
Małgorzata Oleś <dr.malgorzata.oles@gmail.com>
}
\examples{
mylist = list(A=setNames(1:3, nm=letters[1:3]), B=list(D=3:4, setNames("a", nm=2)))
smunlist(mylist)
}