intToAry: Integer to ary-expansion

Description Usage Arguments Value Examples

Description

Ary-expansion of an integer.

Usage

1
intToAry(n, sizes)

Arguments

n

integer to be expanded

sizes

the base of the expansion

Value

A vector of the same length as prod(sizes), the expansion of n.

Examples

1
2
3
4
intToAry(77, c(3,4,7))
2*1 + 1*3 + 6*(3*4)
# Cartesian product {0,1}x{0,1}:
sapply(0:3, function(x) intToAry(x, sizes=c(2,2)))

stla/expansions documentation built on May 30, 2019, 5:46 p.m.