comparison_replace: Replacing Values by Comparison

Description Usage Arguments Details Value See Also Examples

Description

Operators for replacing values using the standard comparison operators.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
x >= y <- value

x > y <- value

x <= y <- value

x < y <- value

x == y <- value

x != y <- value

Arguments

x

first element of the operation.

y

second element of the operation.

value

replacement value.

Details

Thanks to these operators :

Value

x with values for which the comparisons evaluate to TRUE replaced with value.

See Also

`==`

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
ages <- c(130, 10, 1996, 21, 39, 74, -2, 0)

ages == 1996 <- as.numeric(format(Sys.Date(), "%Y")) - 1986
ages

ages > 100 <- NA
ages

ages <= 0 <- NA
ages

inops documentation built on Nov. 19, 2019, 5:08 p.m.