binaryfeaturematrix: Convert a meaning matrix to a binary...

Description Usage Arguments Details Value Examples

View source: R/matrix.R

Description

Transforms a meaning matrix to 'wide' format where, instead of having a column for every meaning dimension store all possible meaning values, every possible value for any dimension is treated as its own categorical 'meaning feature' whose presence or absence is represented by a logical TRUE/FALSE value in its own meaning feature column.

Usage

1

Arguments

meanings

a matrix or data frame with meaning dimensions along columns and different meaning combinations along rows (such as created by enumerate.meaningcombinations).

rownames

optional character vector of the same length as the number of rows of meanings.

Details

Given a matrix or data frame with meaning dimensions along columns and different combinations of meaning feature values along rows, creates a a matrix with the same number of rows but with one column for every possible value for every meaning dimension.

All meaning dimensions and values are treated categorically, i.e. as factors with no gradual notion of meaning feature similarity, neither within nor across the original meaning dimensions. Information about which feature values correspond to which meaning dimensions is essentially discarded in this representation, but could in principle be recovered through the patterns of (non)-co-occurrence of different meaning features.

In order for the resulting meaning columns to be interpretable, the column names of the result are of the structure columnname=value, based on the column names of the input meaning matrix (see Examples).

Value

A matrix of TRUE/FALSE values with as many rows as meanings and one column for every column-value combination in meanings.

Examples

1
2

kevinstadler/cultevo documentation built on June 29, 2017, 8 p.m.