Learn R Programming

rje (version 1.12.1)

subsetOrder: Compare sets for inclusion.

Description

A wrapper for is.subset which returns set inclusions.

Usage

subsetOrder(x, y)

Value

A single integer, 0, -1 or 1.

Arguments

x

A vector.

y

A vector of the same type as x.

Author

Robin Evans

Details

If x is a subset of y, returns -1, for the reverse returns 1. If sets are equal or incomparable, it returns 0.

See Also

is.subset, inclusionMax.

Examples

Run this code

subsetOrder(2:4, 1:4)
subsetOrder(2:4, 3:5)

Run the code above in your browser using DataLab