relist a vector which allows re-ordered names
relist_named(x, skeleton, ...)
vector to be applied to the skeleton
list
structure in order.
list
object representing the desired
final list structure, or vector
when the input
data x
should be returned as-is, without change.
Specifically, when skeleton
is a vector
, the
names(x)
are maintained without change.
additional arguments are ignored.
list
object with the same structure as the skeleton
.
This function is a simple update to utils::relist()
that allows updating the names of each list element.
More specifically, this function does not replace the
updated names with the corresponding names from
the list skeleton
, as is the case in
utils:::relist.default()
.
It is somewhat surprising that utils::relist()
is
simply a nested for loop, instead of rapply()
or some
fancy vectorized alternative. That said, the function works,
and there is much to be commended for functions that work.
Other jam list functions:
cPasteSU()
,
cPasteS()
,
cPasteUnique()
,
cPasteU()
,
cPaste()
,
heads()
,
jam_rapply()
,
list2df()
,
mergeAllXY()
,
mixedSorts()
,
rbindList()
,
rlengths()
,
sclass()
,
sdim()
,
uniques()
,
unnestList()