Learn R Programming

translateSPSS2R (version 1.0.0)

xpssSelectIf: Creates a subset of cases

Description

R Implementation of the SPSS SELECT IF argument. xpssSelectIf permanently selects cases for analysis based on logical conditions.

Usage

xpssSelectIf(x, cond = NULL)

Arguments

x
a (non-empty) data.frame or input data of class "xpssFrame".
cond
logical expression for subsetting the data.

Value

Returns a subset of the actual dataset under the condition of the logical expression.

Details

The condition to select cases are specified in a logical expression. These logical expressions can contain relational operators, logical operators and arithmetic operations.

NOTE: For temporary case selection, specify xpssTemporary before SELECT IF.

See Also

Related Functions xpssDoIf, xpssFilter, xpssTemporary

Examples

Run this code
data(fromXPSS)

temp <- xpssSelectIf(x=fromXPSS, cond = "V3 == 1")

temp <- xpssSelectIf(x=fromXPSS, cond="V4 == 1 & V7_1 < 200")

Run the code above in your browser using DataLab