process_data: Process the data from a CourseKata data download.

View source: R/process_data.R

process_dataR Documentation

Process the data from a CourseKata data download.

Description

This function loads and processes data from a CourseKata end-of-class downloads. To use it, just point it to the zip file or folder that you downloaded from CourseKata and run it. It will load all of the data (showing progress bars along the way) and output it into several data frames: classes, responses, items, page_views, media_views, and tags. If any of those variables already exist, you will be prompted to either allow overwriting or abort the process (if not being run interactively, a message is emitted noting that the variables were overwritten).

Usage

process_data(
  path,
  time_zone = "UTC",
  split_responses = FALSE,
  convert_json = FALSE,
  env = rlang::global_env()
)

Arguments

path

The path to a CourseKata data download zip file or the path to an extracted data download directory.

time_zone

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

split_responses

If TRUE, split the responses out into three tables (surveys, quizzes, in_text) via split_responses.

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.

env

The environment to create the variables in (defaults to the global environment). In most cases, the function will be used interactively and you will want to create the variables in the global environment, so that is the default behavior. In testing or programmatic applications it is useful to control where the variables are created, so an environment can be passed to capture them, e.g. by setting env = rlang::env().

Value

This function returns the environment that the data frames were created in. Usually you can ignore this return value and just use the variables as you need. If you are an advanced user and you supplied an environment to env, that environment is returned.


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