relevantESVN: relevantESVN

Description Usage Arguments Details Value See Also Examples

View source: R/relevantESVN.R

Description

relevantESVN creates a list of the relevant variable names (VN) of (each of) the experience sampling (ES) dataset(s).

Usage

1
2
3
relevantESVN(svyName = NULL, IMEI = NULL, STARTDATE = NULL,
  STARTTIME = NULL, ENDDATE = NULL, ENDTIME = NULL,
  START_DATETIME = NULL, END_DATETIME = NULL)

Arguments

svyName

a vector of character string(s). The column name in (each of) the ESM dataset(s) that specifies the particular survey version.
This is the only optional argument, i.e. if there exists no such column in the raw ESM dataset(s), keep the default value of NULL for this argument. If this default value is kept, the function esList will generate such a column and will fill it with 'ESMVERSION_ESMPREP' in each line of raw ESM data at the current state of the dataset(s).
NOTE: It is not recommended to let esList generate this column, though. For reasons of clarity it is recommended that the user generates such a column for each raw ESM dataset(s) beforehand. The column name of (all) the raw ESM dataset(s) must be identical, however, the content of the new columns must uniquely specify their respective ESM dataset, e.g. "morningControlGroup" for the morning ESM version of the control group.

IMEI

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

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 raw ESM dataset(s). The date and time of both start and end refers to the single ESM questionnaires, i.e. the date and time they actually were started on the phone and the date and time they were finished.

Value

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

See Also

Exemplary code (fully executable) in the documentation of esmprep (function 3 of 28).

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 3 of 28; see esmprep functions' hierarchy.
# ------------------------------------------------------
# With date and time as separate arguments
relEs <- relevantESVN(svyName="survey_name", IMEI="IMEI",
STARTDATE="start_date", STARTTIME="start_time",
ENDDATE="end_date", ENDTIME="end_time")
# With date-time objects instead of separate date and time
relEs <- relevantESVN(svyName="survey_name", IMEI="IMEI",
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 9, 2018, 11:27 a.m.