removeRedundant: Set operations

Description Usage Arguments Details Author(s) Examples

View source: R/setopsC.R

Description

Miscellaneous set operations.

Usage

1
2
3
4
5
is.subsetof(x, set)
is.insetlist(x, setlist, index=FALSE)
removeRedundant(setlist, maximal = TRUE, index = FALSE)
maximalSets(setlist,  index = FALSE)
minimalSets(setlist,  index = FALSE)

Arguments

x, set

Vectors representing sets

setlist

List of vectors (representing a set of subsets)

maximal

Logical; see section 'Details' for a description.

index

Logical; should indices (in setlist) be returned or a set of subsets.

Details

'setlist' is a list of vectors representing a set of subsets; i.e. V1,...VQ where Vk is a subset of some base set V.

is.insetlist: Checks if the set x is in one of the Vk's.

removeRedundant: Returns those Vk which are not contained in other subsets; i.e. gives the maximal sets. If maximal is FALSE then returns the minimal sets; i.e. Vk is returned if Vk is contained in one of the other sets Vl and there are no set Vn contained in Vk.

Notice that the comparisons are made by turning the elements into characters and then comparing these. Hence 1 is identical to "1".

Author(s)

S<f8>ren H<f8>jsgaard, sorenh@math.aau.dk

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
is.subsetof(c(1,2),c(1,2,3))
is.subsetof(c(1,2,3), c(1,2))

l <- list(c(1,2),c(1,2,3),c(2,4),c(5,6), 5)

#subsetofList(c(1,2), l)
#subsetofList(c(1,2,3,4), l)

removeRedundant(l)
removeRedundant(l, maximal=FALSE)

is.insetlist (c(2,4), l)
is.insetlist (c(2,8), l)

gRbase documentation built on May 2, 2019, 4:51 p.m.