conversion: Conversion between Representations of Responses or States

Description Usage Arguments Value See Also Examples

Description

Converts between binary matrix and pattern representations of response patterns or knowledge states.

Usage

1
2
3
as.pattern(R, freq = FALSE, as.letters = FALSE, as.set = FALSE)

as.binmat(N.R, uniq = TRUE, col.names = NULL)

Arguments

R

an indicator matrix of response patterns or knowledge states.

N.R

either a (named) vector of absolute frequencies of response patterns; or a character vector of response patterns or knowledge states; or a set of sets representing the knowledge structure.

freq

logical, should the frequencies of response patterns be reported?

uniq

logical, if TRUE, only the unique response patterns are returned.

as.letters

logical, return response patterns as combinations of letters.

as.set

logical, return response patterns as set of sets.

col.names

column names for the state or response matrix.

Value

as.pattern returns a vector of integers named by the response patterns if freq is TRUE, else a character vector. If as.set is TRUE, the return value is of class set.

as.binmat returns an indicator matrix.

See Also

blim, set in package sets.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(DoignonFalmagne7)
as.pattern(DoignonFalmagne7$K)
as.pattern(DoignonFalmagne7$K, freq = TRUE)
as.pattern(DoignonFalmagne7$K, as.letters = TRUE)
as.pattern(DoignonFalmagne7$K, as.set = TRUE)

dim(as.binmat(DoignonFalmagne7$N.R))
dim(as.binmat(DoignonFalmagne7$N.R, uniq = FALSE))

## Knowledge structure as binary matrix
as.binmat(c("000", "100", "101", "111"))
as.binmat(set(set(), set("a"), set("a", "c"), set("a", "b", "c")))

pks documentation built on May 26, 2019, 1 a.m.

Related to conversion in pks...