Builds a comparison operator for use inside attribute functions such as age, valueAsNumber, startDate, etc. Accepts integer, numeric, or Date inputs; returns the matching opAttribute type.

gt(x)

# S4 method for integer
gt(x)

# S4 method for numeric
gt(x)

# S4 method for Date
gt(x)

Arguments

x

Comparison bound (integer, numeric, or Date).

Value

An opAttribute for use inside attribute constructor functions.

See also

lt, gte, lte, eq, bt

Examples

# HbA1c > 6.5
measurement(cs(1L, name = "HbA1c"), valueAsNumber(gt(6.5)))
#> <Capr Measurement Query> HbA1c