compactList: Concatenate list elements

Description Usage Arguments Details Value Author(s) References Examples

View source: R/compactList.R

Description

Concatenates given elements of a list.

Usage

1
compactList(lst,l)

Arguments

lst

list object

l

numeric vector specifying the number of list elements to be concatenated sequentially

Details

By definition, the output list is shorter than the input list.

Function stops if 'sum(l)' does not equal 'lenght(lst)'.

Value

clst

list of length 'length(l)' where the 'i'-th element has length 'l[i]' and contains concatenated elements of input list 'lst'.

Author(s)

Alexandre Kuhn

References

Kuhn et al. Cross-species and cross-platform gene expression studies with the Bioconductor-compliant R package 'annotationTools'. BMC Bioinformatics, 9:26 (2008)

Examples

1
2
3
4
5
6
7
##an example list
lst<-vector('list',3)
lst[[1]]<-c('aaa','bbb')
lst[[2]]<-'ccc'
lst[[3]]<-'zzz'
##merge first 2 list elements
compactList(lst,c(2,1))

annotationTools documentation built on Nov. 8, 2020, 6:58 p.m.