View source: R/response-class-methods.R
as.data.frame.Response | R Documentation |
Response-class
object into a data.frame
.This function converts Response-class
objects to a
data.frame
object.
## S3 method for class 'Response' as.data.frame( x, row.names = NULL, optional = FALSE, ..., attach_unique_misc = TRUE )
x |
An |
row.names |
|
optional |
logical. If |
... |
additional arguments |
attach_unique_misc |
If |
A data frame of item_ids/responses/scores within each row.
Emre Gonulates
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.