resp <- response(examinee_id = "Stu12",
item_id = c("Item1", "Item2", "Item3", "Item4"),
score = c(0, 1, 1, 1),
raw_response = c("B", "A", "D", "Right Angle"),
order = c(1L, 2L, 3L, 4L),
misc = list(item_role = c("F", "O", "O", "O"),
lexile_level = c(1, 4, 3, 1),
item_type = c("MC", "MC", "MS", "SA"),
test_date = as.Date("2021-11-21"),
Form = "Test Form 001",
theta = 2.2))
as.data.frame(resp)
# Do not include misc fields whose lengths are not equal to the number of
# items
as.data.frame(resp, attach_unique_misc = FALSE)
Run the code above in your browser using DataLab