relevantREFVN: relevantREFVN

Description Usage Arguments Details Value See Also Examples

Description

relevantREFVN creates a list of the relevant variable names (VN) of the reference (REF) dataset.

Usage

1
2
3
relevantREFVN(ID = NULL, IMEI = NULL, ST = NULL, STARTDATE = NULL,
  STARTTIME = NULL, ENDDATE = NULL, ENDTIME = NULL,
  START_DATETIME = NULL, END_DATETIME = NULL)

Arguments

ID

a character string that specifies the column name which holds the unique identification code for the participant.

IMEI

a character string. Column name that specifies the variable in the respective dataset holding the the IMEI number.

ST

a character string. It must be the first component of the column name in the reference dataset that specifies the prompts on the mobile device, e.g. ST for scheduled time. The column names must all be equal except for the last character, which must specify the respective number of the prompt, e.g. ST3 for the third prompt of the day.

STARTDATE

a character string that specifies the column name in the respective dataset holding the date of when the participant started ... see Details.

STARTTIME

a character string that specifies the column name in the respective dataset holding the time of when the participant started ... see Details.

ENDDATE

a character string that specifies the column name in the respective dataset holding the date of when the participant ended ... see Details.

ENDTIME

a character string that specifies the column name in the respective dataset holding the time of when the participant ended ... see Details.

START_DATETIME

a character string. If STARTDATE and STARTTIME are not in two separate columns but are combined as a date-time object in a single column pass that column's name and ignore the arguments STARTDATE and STARTTIME.

END_DATETIME

a character string. If ENDDATE and ENDTIME are not in two separate columns but are combined as a date-time object in a single column pass that column's name and ignore the arguments ENDDATE and ENDTIME.

Details

The relevant variable names (i.e. column names) must refer to the reference dataset. The date and time of both start and end refers to the ESM period for each participant, starting with the date and time he/she fills out the very first ESM questionnaire on his/her own and ending with the date and time he/she fills out the very last ESM questionnaire.

Value

A list of the relevant variable/column names in the reference dataset. To be used as the last argument in the function setREF. The last element of the list is a logical value indicating whether the date and time are either separated (TRUE) or a single date-time object (FALSE). It is meaningful only for the subsequent function setREF.

See Also

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# 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
# ------------------------------------------------------
# Run function 1 of 29; see esmprep functions' hierarchy.
# ------------------------------------------------------
# With date and time as separate arguments
relRef <- relevantREFVN(ID="id", IMEI="imei", ST="st",
STARTDATE="start_date", STARTTIME="start_time",
ENDDATE="end_date", ENDTIME="end_time")
# 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")
# 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.