int2set: Alternate between sets and integers representing sets of...

int2setR 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

  • set2int: Convert sets to integers


rje documentation built on Nov. 12, 2022, 9:06 a.m.