enumerate.meaningcombinations: Enumerate meaning combinations.

View source: R/matrix.R

enumerate.meaningcombinationsR Documentation

Enumerate meaning combinations.

Description

Enumerates all possible combinations of meanings for a meaning space of the given dimensionality.

Usage

enumerate.meaningcombinations(dimensionality, uniquelabels = TRUE, offset = 0)

Arguments

dimensionality

either a) a vector of integers specifying the number of different possible values for every meaning dimension, or b) a list or other (potentially ragged) 2-dimensional data structure listing the possible meaning values for every dimension

uniquelabels

logical, determines whether the same integers can be reused across meaning dimensions or not. When uniquelabels = FALSE, the resulting matrix will be very reminiscent of tables listing all binary combinations of factors. Ignored when dimensionality specifies the meaning values

offset

a constant that is added to all meaning specifiers. Ignored when dimensionality specifies the meaning values

Details

The resulting matrix can be passed straight on to hammingdists and other meaning distance functions created by wrap.meaningdistfunction.

Value

A matrix that has as many columns as there are dimensions, with every row specifying one of the possible meaning combinations. The entries of the first dimension cycle slowest (see examples).

See Also

hammingdists

Examples

enumerate.meaningcombinations(c(2, 2))
enumerate.meaningcombinations(c(3, 4))
enumerate.meaningcombinations(c(2, 2, 2, 2))
enumerate.meaningcombinations(8) # trivial
enumerate.meaningcombinations(list(shape=c("square", "circle"), color=c("red", "blue")))

kevinstadler/cultevo documentation built on Jan. 13, 2024, 11:22 p.m.