int2set {rje}R Documentation

Alternate between sets and integers representing sets of integers via bits

Description

Alternate between sets and integers representing sets of integers via bits

Usage

int2set(n, index = 1, simplify = FALSE)

set2int(x, index = 1)

Arguments

n

integer respresenting a set

index

integer to start from

simplify

logical: return a single list if n has length 1?

x

list of sets

Details

Converts an integer into its binary representation and interprets this as a set of integers. Cannot handle sets with more than 31 elements.

Value

For int2set a list of sets one for each integer supplied, for set2int a vector of the same length as the number of sets supplied.

Functions


[Package rje version 1.12.1 Index]