Provides a way to create an object as a "item_matrix"
.
item_matrix(x)
x | Either a |
---|
A item_matrix
object.
# 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#> An item matrix: 3 x 2 #> #> Item1 Item2 #> Subject1 1 1 #> Subject2 0 1 #> Subject3 0 1# 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#> An item matrix: 6 x 2 #> #> Item1 Item2 #> Subject1 1 0 #> Subject2 0 1 #> Subject3 1 0 #> Subject4 1 1 #> Subject5 0 1 #> Subject6 1 0