rmInvalid {esmprep} | R Documentation |
rmInvalid
Description
removeInvalid removes the invalid ESM questionnaires as specified by the user.
Usage
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 |
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:
dfValid, i.e. the raw ESM dataset(s), after removing all invalid lines of data.
listInvalid, i.e. the raw ESM dataset(s), containing only the removed lines of data.
rmInvalidFinished, i.e. a logical value, specifying whether at least one line of data was removed due to being invalid.
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
# 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