Generate a set of targets for pre-processing of iQuizoo data
Source:R/targets.R
tar_prep_iquizoo.Rd
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 = 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
params
is 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_name
andgame_name
, in that order. Set the column asNA
to skip that parameter. Ifcontents
is specified, it should be a data.frame and will be used directly as the configuration of data fetching. Notecontents
should at least containproject_id
andgame_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 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. Ifwhat
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")
. 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
FALSE
if the project is finalized.- cache
The cache to be used in
fetch_iquizoo_mem()
.