convertSUSTAIN: Convert nominal-dimension input representation into a...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/convertSUSTAIN.R

Description

Changes a nominal-dimension input representation (e.g. 3 1 2) into a padded representation (e.g. 001 100 010). This form out input representation is required by e.g. slpSUSTAIN.

Usage

1
convertSUSTAIN(input, dims)

Arguments

input

A matrix containing the nominal-dimension input representation. Each row is a trial and each column is a stimulus dimension.

dims

A vector of the number of nominal values for each dimension. For example, if there are three dimensions with three, one and two possible values, then dims = c(3, 1, 2).

Value

Returns a matrix containing the padded input representation.

Author(s)

Lenard Dome, Andy Wills

See Also

slpSUSTAIN

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Create a dummy training matrix with two dimensions. The first
## two dimensions have two possible nominal values, while the
## third and fourth have three possible nominal values.

dummy <- cbind(matrix(sample(1:2, 20, replace=TRUE), ncol = 2),
               matrix(sample(1:3, 20, replace=TRUE), ncol = 2))

## Specify the number of nominal spaces for each dimension
dims <- c(2, 2, 3, 3)

## Convert the input representation into a binary padded representation
convertSUSTAIN(dummy, dims)

catlearn documentation built on Sept. 16, 2020, 5:07 p.m.