Skip to contents

This target factory prepares a set of target objects used to fetch data from iQuizoo database, separated into static branches so that each is for a specific project and task/game combination. Further pre-processing on the fetched data can also be added if requested.

Usage

tar_prep_iquizoo(
  params,
  contents,
  ...,
  what = c("raw_data", "scores"),
  action_raw_data = c("all", "parse", "none"),
  combine = NULL,
  subset_users_props = NULL,
  templates = setup_templates(),
  check_progress = TRUE,
  cache = NULL
)

Arguments

params, contents

Used as the configuration of data fetching. These two arguments are mutually exclusive. If params is specified, it will be used as parameters to be bound to the query, see DBI::dbBind() for more details. The default template requires specifying organization_name, project_name, course_name and game_name, in that order. Set the column as NA to skip that parameter. If contents is specified, it should be a data.frame and will be used directly as the configuration of data fetching. Note contents should at least contain project_id and game_id names.

...

For future usage. Should be empty.

what

What to fetch. There are basically two types of data, i.e., raw data and scores. The former is the logged raw data for each trial of the tasks/games, and further actions on the fetched raw data can be specified by action_raw_data. The latter is the scores calculated by iQuizoo server.

action_raw_data

The action to be taken on the fetched raw data. There are two consecutive actions, i.e., raw data parsing and pre-processing. The former will parse the json formatted raw data into data.frame()s and wrap them into one list column, see parse_data() for more details. The latter will calculate indices based on the parsed data, see preproc.iquizoo::preproc_data() for more details. If set as "none", neither will be done. If set as "parse", only raw data parsing will be done. If set as "all", both parsing and pre-processing will be done. If what is set as "scores", this argument will be ignored.

combine

Specify which targets to be combined. Note you should only specify names from c("scores", "raw_data", "raw_data_parsed", "indices"). If NULL, none will be combined.

subset_users_props

The subset of user properties to be fetched. See get_users_props_names() for all the available properties. If NULL, all properties will be fetched.

templates

The SQL template files used to fetch data. See setup_templates() for details.

check_progress

Whether to check the progress hash. Set it as FALSE if the project is finalized.

cache

The cache to be used in fetch_iquizoo_mem().

Value

A list of target objects.