bin: Sundry binary functionality

Description Usage Arguments Details Author(s) References Examples

Description

Utilities to convert things to binary

Usage

1
2
3
4

Arguments

n

Integer, to be converted to binary by function tobin()

len

Length of the binary vector returned by function tobin()

bin

Binary: a vector of 0s and 1s

comp

A composition

check

Boolean, with default TRUE meaning to perform various checks

use.C

Boolean, with default TRUE meaning to use C

Details

These functions are not really intended for the end user; they are used in nextcomposition().

Author(s)

Robin K. S. Hankin

References

Wikipedia contributors, 2020. “Composition (combinatorics) — Wikipedia, The Free Encyclopedia”, https://en.wikipedia.org/w/index.php?title=Composition_(combinatorics)&oldid=944285378

Examples

1
2
3
4
tobin(10,5)
todec(tobin(10,5))
comptobin(c(1,1,4))
bintocomp(c(1,1,0,0,1,1,1,1))

RobinHankin/partitions documentation built on Feb. 18, 2021, 2:26 a.m.