make_pairs: Combinations and permutations of record-sets.

View source: R/make_pairs.R

make_pairsR Documentation

Combinations and permutations of record-sets.

Description

Combinations and permutations of record-sets.

Usage

sets(n, r, permutations_allowed = TRUE, repeats_allowed = TRUE)

make_sets(
  x,
  r,
  strata = NULL,
  permutations_allowed = TRUE,
  repeats_allowed = TRUE
)

make_pairs(
  x,
  strata = NULL,
  repeats_allowed = TRUE,
  permutations_allowed = FALSE
)

make_pairs_wf_source(..., data_source = NULL)

Arguments

n

[integer]. Size of Vector.

r

[integer]. Number of elements in a set.

permutations_allowed

[logical]. If TRUE, permutations of the same set are included.

repeats_allowed

[logical]. If TRUE, repeat values are included in each set.

x

[atomic]. Vector.

strata

Subsets of x. Blocking attribute. Limits the creation of combinations or permutations to those from the same strata.

...

Arguments passed to make_pairs.

data_source

[character]. Data source identifier. Limits the creation of combinations or permutations to those from a different data_source

Details

set() - Create r-set combinations or permutations of n observations.

make_set() - Create r-set combinations or permutations of vector x.

make_pairs() - Create 2-set combinations or permutations of vector x.

make_pairs_wf_source() - Create 2-set combinations or permutations of vector x that are from different sources (data_source).

Value

A list of a vector's elements and corresponding indexes.

See Also

eval_sub_criteria

Examples


sets(4, 2)
sets(4, 2, repeats_allowed = FALSE, permutations_allowed = FALSE)
make_sets(month.abb[1:4], 2)
make_sets(month.abb[1:4], 3)

make_pairs(month.abb[1:4])
make_pairs(month.abb[1:4], strata = c(1, 1, 2, 2))
make_pairs_wf_source(month.abb[1:4], data_source = c(1, 1, 2, 2))


diyar documentation built on Nov. 13, 2023, 1:08 a.m.