setREF: setREF

Description Usage Arguments Details Value See Also Examples

Description

setREF sets the relevant variable names concerning the reference dataset.

Usage

1
setREF(MAXPROMPT = NULL, REFVN = NULL)

Arguments

MAXPROMPT

a numeric value. The number of prompts per day.

REFVN

a list. Each element of the list must specify one of the relevant column names of the reference dataset; i.e. the identification number (e.g. ID), the IMEI number, the character substring that all columns have in common which specify the prompt time, the start date, the start time, the end date, and the end time. Use function relevantREFVN to generate REFVN.

Details

The list is named "RELEVANTVN_REF". It contains either 5 or 7 elements, depending on whether the start date and the start time already exist as a date-time object (same for end date and end time). In the latter case the list elements' names are:

  1. REF_ID: the column name in the reference dataset holding the name of the unique participant identification code.

  2. REF_IMEI: the column name in the reference dataset holding the IMEI number.

  3. REF_ST: the column name in the reference dataset holding the scheduled times (st)/prompts, except for the numeric end of the column name.

  4. REF_START_DATETIME: the date-time object of when the very first ESM questionnaire was scheduled/prompted.

  5. REF_END_DATETIME: the date-time object of when the very last ESM questionnaire was scheduled/prompted.

If the start date and start time (same for end date and end time) are separated, the list elements will be

  1. REF_ID: the column name in the reference dataset holding the name of the unique participant identification code.

  2. REF_IMEI: the column name in the reference dataset holding the IMEI number.

  3. REF_ST: the column name in the reference dataset holding the scheduled times (st)/prompts, except for the numeric end of the column name.

  4. REF_START_DATE: the date of when the very first ESM questionnaire was scheduled/prompted.

  5. REF_START_TIME: the time of when the very first ESM questionnaire was scheduled/prompted.

  6. REF_END_DATE the date of when the very last ESM questionnaire was scheduled/prompted.

  7. REF_END_TIME the time of when the very last ESM questionnaire was scheduled/prompted.

The last element of the output list will always be "REF_DATETIMES_SEP": TRUE if date and time are separated, FALSE if they are a single date-time object.

Value

A list. Each element of the list is named according to the variable's content. See Details for more information.

See Also

Exemplary code (fully executable) in the documentation of esmprep (function 2 of 29).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o
# Prerequisites in order to execute setREF. Start  ------------------
relRef <- relevantREFVN(ID="id", IMEI="imei", ST="st",
STARTDATE="start_date", STARTTIME="start_time",
ENDDATE="end_date", ENDTIME="end_time")
# Prerequisites in order to execute setREF. End ---------------------
# ------------------------------------------------------
# Run function 2 of 29; see esmprep functions' hierarchy.
# ------------------------------------------------------
# 4 is the number of daily prompts.
# relRef is the result of function 'relevantREFVN'
# Relevant variables names of reference dataset.
(RELEVANTVN_REF <- setREF(4, relRef))
# With date-time objects instead of separate date and time
relRef <- relevantREFVN(ID="id", IMEI="imei", ST="st",
START_DATETIME="start_dateTime", END_DATETIME="end_dateTime")
(RELEVANTVN_REF <- setREF(4, relRef))
# o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o

mmiche/esmprep documentation built on July 7, 2019, 8:23 p.m.