rmInvalid: rmInvalid

Description Usage Arguments Details Value See Also Examples

Description

removeInvalid removes the invalid ESM questionnaires as specified by the user.

Usage

1
rmInvalid(dfList, RELEVANTVN_ES = NULL)

Arguments

dfList

a list. Each element of the list must be a data.frame. Each data.frame is a separate raw ESM dataset/an ESM questionnaire version. If there is just one ESM version the list therefore contains one data.frame.

RELEVANTVN_ES

a list. This list is generated by function setES and it is extended once either by function genDateTime or by function splitDateTime.

Details

A data line is assumed to be invalid if both the start date and the start time are missing (NA = not available).

Value

The user receives a list containing 4 elements:

  1. dfValid, i.e. the raw ESM dataset(s), after removing all invalid lines of data.

  2. listInvalid, i.e. the raw ESM dataset(s), containing only the removed lines of data.

  3. rmInvalidFinished, i.e. a logical value, specifying whether at least one line of data was removed due to being invalid.

  4. noLinesRemovedAtAll, i.e. a logical vector, specifying in which of the ESM raw dataset(s) there were invalid lines of data.

See Details for more information.

See Also

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# 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 rmInvalid. Start ----------------
# Use example list delivered with the package
RELEVANTVN_ES <- RELEVANTVN_ESext
# keyLsNew is a list of datasets, also delivered with the package
# Prerequisites in order to execute rmInvalid. End ------------------
# ------------------------------------------------------
# Run function 9 of 29; see esmprep functions' hierarchy.
# ------------------------------------------------------
# keyLsNew is the result of function 'genDateTime' (or of function 'splitDateTime').
rmInvLs <- rmInvalid(keyLsNew, RELEVANTVN_ES)
# Result of function 'rmInvalid' is a list with 4 elements:
names(rmInvLs)
# 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.