fuseCommonListElem: Fuse content of list-elements with redundant (duplicated)...

View source: R/fuseCommonListElem.R

fuseCommonListElemR Documentation

Fuse content of list-elements with redundant (duplicated) names

Description

fuseCommonListElem fuses (character or numeric) elements of list re-occuring under same name, so that resultant list has unique names. Note : will not work with list of matrixes

Usage

fuseCommonListElem(
  lst,
  initOrd = TRUE,
  removeDuplicates = FALSE,
  callFrom = NULL
)

Arguments

lst

(list) main input, list of numeric vectors

initOrd

(logical) preserve initial order in output (if TRUE) or otherwise sort alphabetically

removeDuplicates

(logical) allow to remove duplicate entries (if vector contains names, both the name and the value need to be identical to be removed; note: all names must have names with more than 0 characters to be considered as names)

callFrom

(character) allows easier tracking of message(s) produced

Value

fused list (same names as elements of input)

See Also

unlist

Examples

val1 <- 10 +1:26
names(val1) <- letters
lst1 <- list(c=val1[3:6],a=val1[1:3],b=val1[2:3],a=val1[12],c=val1[13])
fuseCommonListElem(lst1)

wrMisc documentation built on Sept. 11, 2024, 6:10 p.m.