This help topic is for R version 1.1. For the current version of R, try https://stat.ethz.ch/R-manual/R-patched/library/base/html/Comparison.html
Comparison {base}R Documentation

Relational Operators

Description

Binary operators which allow the comparison of values in vectors.

Usage

x < y
x > y
x <= y
x >= y
x == y
x != y

Value

A vector of logicals indicating the result of the element by element comparison. The elements of shorter vectors are recycled as necessary.

Objects such as arrays or time-series can be compared this way provided they are conformable.

Examples

x <- rnorm(20)
x < 1
x[x > 0]

[Package base version 1.1 ]