View source: R/convertSUSTAIN.R
convertSUSTAIN | R Documentation |
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
.
convertSUSTAIN(input, dims)
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 |
Returns a matrix containing the padded input representation.
Lenard Dome, Andy Wills
slpSUSTAIN
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.