Learn R Programming

crunch (version 1.30.4)

rowDistinct: Create variables useful for determining whether a row's values are suspicious

Description

rowDistinct() finds the number of unique values given per row of variables in an array CrunchVariable. straightlineResponse() returns a selection variable that indicates whether the responses are identical. When a row has all columns that are missing of the same type, it will return Selected, but will missing if any other number of values is missing (or there are multiple types of missing).

Usage

rowDistinct(x, name, ..., na.rm = TRUE)

straightlineResponse(x, name, ...)

Value

A Variable Definition, which can be used to create a new CrunchVariable

Arguments

x

A CrunchVariablethat is an an array, that unique values should be counted across.

name

a character to use as the name of the case variable to create

...

Optional attributes, like description, to set on the new variable (passed to VarDef())

na.rm

Whether to count missing data as a separate category (all missing categories will be lumped together)

See Also

rowCount() for other row-wise functions