item_matrix: Create an Item Matrix Object

Description Usage Arguments Value See Also Examples

View source: R/item-matrix.R

Description

Provides a way to create an object as a "item_matrix".

Usage

1

Arguments

x

Either a data.frame or matrix.

Value

A item_matrix object.

See Also

as_item_matrix()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# Item matrix values
x = matrix(c(1, 0, 0, 1, 1, 1), ncol = 2)

# Item matrix initialization
items = item_matrix(x)

# View item matrix
items

# Data Frame encoding of items
items_df = data.frame(
   s1 = c(1, 0, 1, 1, 0, 1),
   s2 = c(0, 1, 0, 1, 1, 0)
)

# Create an Item Matrix
items = item_matrix(items_df)

# View item matrix
items

tmsalab/edmcore documentation built on Sept. 4, 2021, 2:46 a.m.