Description Usage Arguments Details Value Author(s) See Also Examples
R implementation of the SPSS DO IF
argument.
1 |
x |
a (non-empty) data.frame or input data of class |
cond |
logical expression indicating the condition for subsetting. |
xpssDoIf selects cases for analysis based on one or more logical conditions. The conditions to select cases are specified in a logical expression. These logical expressions can contain relational operators, logical operators and arithmetic operations. xpssDoIf creates a subset of the actual dataset, without deleting the excluded variables, respectively without deleting the excluded values.
If its needed to modify more than one subset, every following subset get selected by xpssElseIf
. xpssDoIf
is working similar to xpssElseIf
, the only difference is that xpssDoIf
has to initiate the subsetting.
The data is subsetted until xpssEndIf
restores the excluded data. All changes made at the subsetted data will be taken over, the excluded data will remain untouched! As noted before, those cases are not actually deleted and will be available after xpssEndIf
restores the excluded data.
In a different way to SPSS. Not only data management functions like xpssRecode
can be used within xpssDoIf
, it is possible to use statistical and descriptiv functions like xpssFrequencies
too.
NOTE: For temporary case selection, specify xpssTemporary
before xpssDoIf
.
Output is a subset of the actual dataset under the condition of the logical expression.
Andreas Wygrabek
Related Functions xpssElseIf
, xpssEndIf
, xpssFilter
, xpssSelectIf
, xpssTemporary
1 2 3 4 5 6 7 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.