r_and(C;S)

Returns a boolean value indicating whether all the values in a given set of columns are true.

Function type

Vector only

Syntax

r_and(C;S)

Input

Argument Type Description
C integer A space- or comma-separated list of column names

C may also be a string expression (in single quotes) constituting a pattern for matching columns. For instance, 'foo*' specifies all columns that begin with "foo".

If C is omitted, the values in all of the columns are included.

All values in the columns listed in C must be either 0 or 1.

S integer A boolean column or an expression in rcv_/rcn_/rct_ which determines whether or not that column is selected to be included in the calculation. See System variables for more information about rcv_/rcn_/rct_.

If S is omitted, all columns will be considered by the function (subject to any prior column selections).

Return Value

For each row of the table, r_and returns an integer value of 1 if all of the values in the columns listed in C are equal to 1.