randomMultSelection {esmprep} | R Documentation |
randomMultSelection
Description
randomMultSelection selects ESM questionnaires randomly as specified by the user.
Usage
randomMultSelection(esDf)
Arguments
esDf |
a data.frame. A single ESM dataset. It must contain the 2 columns that hold the date-time object for when an ESM questionnaire was started and finished, respectively. |
Details
If randomMultSelection
has to be applied it should better be applied only once at the very end of the study. Otherwise the randomness of the selection no longer holds.
Value
The user receives a list containing 2 datasets:
esRandSelIn, i.e. the ESM dataset with the lines of data, of which some had to be randomly selected
esRandSelOut, i.e. the lines of data that had to be randomly removed.
See Details for more information.
See Also
Exemplary code (fully executable) in the documentation of esmprep
(function 25 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 randomMultSelection. Start ------
# RELEVANTINFO_ES is delivered with the package
intoleranceDf <- data.frame(prompt = c(2, 3, 4, 1, 1),
expect = c(1, 1, 1, 2, 3))
# expectedDf is a raw ESM dataset, delivered with the package.
intolLs <- intolerable(expectedDf, intoleranceDf, RELEVANTINFO_ES)
# Prerequisites in order to execute randomMultSelection. End --------
# -------------------------------------------------------
# Run function 25 of 29; see esmprep functions' hierarchy.
# -------------------------------------------------------
# intolLs[["cleanedDf"]] is the result of function 'intolerable'.
randSelLs <- randomMultSelection(intolLs[["cleanedDf"]])
# 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