makePairs: Returns possible pairs from one or two vectors of values

Description Usage Arguments Details Value Examples

View source: R/Math.R

Description

If only one vector of values is given, all unique pairs within these values are returned. For example 2-3 is there but not 3-2.

Usage

1
makePairs(cl1 = "", cl2 = NULL, excludeOneNumberPair = TRUE)

Arguments

cl1

Numeric vector containing a vector of values

cl2

Optional argument containing a second vector of values

excludeOneNumberPair

Logical indicating whether to include pairs with the same number when two vectors are used (e.g 2-2).

Details

If two vectors of values are given, all possible combinations of the two vectors are returned. For example 2-2 if both vectors contain number 2, 2-3 and 3-2 would be included if 2 and 3 are in both vectors.

Value

A data.frame containing the pairs

Examples

1
makePairs(cl1=1:10)

kevin-allen/relectro documentation built on May 20, 2019, 9:06 a.m.