Logical "or" operator.
Value
For !
, a logical or raw vector(for raw x
) of the same
length as x
: names, dims and dimnames are copied from x
,
and all other attributes (including class) if no coercion is done.
For |
, &
and xor
a logical or raw vector. If
involving a zero-length vector the result has length zero. Otherwise,
the elements of shorter vectors are recycled as necessary (with a
warning
when they are recycled only fractionally).
The rules for determining the attributes of the result are rather
complicated. Most attributes are taken from the longer argument, the
first if they are of the same length. Names will be copied from the
first if it is the same length as the answer, otherwise from the
second if that is. For time series, these operations are allowed only
if the series are compatible, when the class and tsp
attribute of whichever is a time series (the same, if both are) are used. For arrays (and an array result) the dimensions and dimnames are taken from first argument if it is an array, otherwise the second.
For ||
, &&
and isTRUE
, a length-one logical vector.
Details
See base::Logic for more details.