Combinations: Generate Combinations

Description Usage Arguments Examples

View source: R/Combinations.R

Description

Given an intenger n, generate all binary combinations of n elements, transformed to indices. This is primarily for use with the CellCounts function, but may be useful for users in some scenarios.

Usage

1

Arguments

n

An integer.

Examples

1

Example output

[[1]]
[1] 1 2 3

[[2]]
[1] -1  2  3

[[3]]
[1]  1 -2  3

[[4]]
[1] -1 -2  3

[[5]]
[1]  1  2 -3

[[6]]
[1] -1  2 -3

[[7]]
[1]  1 -2 -3

[[8]]
[1] -1 -2 -3

COMPASS documentation built on Nov. 8, 2020, 8:05 p.m.