Generate a set of targets for pre-processing of iQuizoo data
Source:R/targets.R
tar_prep_iquizoo.RdThis 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 = get_users_props_names(),
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
paramsis specified, it will be used as parameters to be bound to the query, seeDBI::dbBind()for more details. The default template requires specifyingorganization_name,project_name,course_nameandgame_name, in that order. Set the column asNAto skip that parameter. Ifcontentsis specified, it should be a data.frame and will be used directly as the configuration of data fetching. Notecontentsshould at least containproject_idandgame_idnames.- ...
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
jsonformatted raw data intodata.frame()s and wrap them into one list column, seeparse_data()for more details. The latter will calculate indices based on the parsed data, seepreproc.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. Ifwhatis 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"). IfNULL, 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.- 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
FALSEif the project is finalized.- cache
The cache to be used in
fetch_iquizoo_mem().