convert_types_in_responses: Convert the columns in a responses table to the appropriate...

View source: R/process_responses.R

convert_types_in_responsesR Documentation

Convert the columns in a responses table to the appropriate types.

Description

convert_types_in_responses() takes a CourseKata responses table and returns a responses table with all of the same data except that the variables in the table are converted to appropriate types:

  • integer: attempt, lrn_question_position

  • number: points_possible, points_earned

  • date-time: dt_submitted, lrn_dt_started, lrn_dt_saved

  • list: lrn_response_json

  • character: all other columns not listed above

Usage

convert_types_in_responses(responses, time_zone = "UTC", convert_json = FALSE)

Arguments

responses

A CourseKata responses table (e.g. from responses.csv).

time_zone

The time zone to use when parsing date-time objects (see timezones).

convert_json

For speed of processing, columns containing JSON are just read in as strings. If you are going to use these data, it may be useful to convert them to lists by specifying this argument as TRUE.

Value

A table of the same size as responses with an appropriate type for each variable.

See Also

process_responses


UCLATALL/CourseKataData documentation built on Dec. 4, 2023, 2:25 a.m.