recode_subjects: Set unique subject IDs

Description Usage Arguments Details Value

View source: R/utils.R

Description

Ibex provides 2 pieces of information identifying a participant: timestamp of the moment when the results and md5 hash of browser and system information. Neither of these parameters in itself is guaranteed to be unique; their combination has more chances of being so.

Usage

1
recode_subjects(d, short_ids = TRUE)

Arguments

d

data.frame with (a subset of) Ibex data

short_ids

logical. If 'FALSE', just merge timestamp and md5 hash together, If 'TRUE' (default), add a new column with a simple index to idenitfy subjects. One index is assigned to each combination of timestamp and browser md5 hash. The column is put at the place of 'subj_uid' column, and 'subj_uid' column is moved at the very end of the data.frame (in order not to interfere with column deletion; otherwise we would have to offset the indices of columns specified for deletion by 1).

Details

This function merges the timestamp and md5 into a single string (separated by "_"), and puts it into 'subj_uid' column (which replaces the 'timestamp' column. If necessary, timestamp can be extracted by simply breaking the combined string at "_").

Value

data.frame with updated subject codes


antonmalko/ibextor documentation built on May 25, 2019, 2:26 p.m.