indexesMerge {bsearchtools}R Documentation

Intersection / union of list of indexes

Description

Functions to perform intersection or union of a list of integer vectors. This functions are used by DFI.subset for AND/OR filters

Usage

intersectIndexesList(lst,sorted=TRUE)
unionIndexesList(lst,sorted=TRUE)

Arguments

lst

list of integer vectors on which intersection or union must be performed

sorted

logical value used to specify if the returned indexes should be sorted ascending (default TRUE)

Details

The returned vector is sorted ascending. intersectIndexesList is implemented in C++ and corresponds to sort(unique(Reduce(f=intersect,x=lst))) (without the sort function if sorted=FALSE). unionIndexesList is partially implemented in C++ and corresponds to sort(unique(Reduce(f=union,x=lst))) (without the sort function if sorted=FALSE).

Value

A vector of integers.

Examples

intersectIndexesList(list(1:7,4:8,3:5))
unionIndexesList(list(1:7,4:8,3:5))

[Package bsearchtools version 0.0.61 Index]