[ top | up ]

Are All Values True?

Syntax

all(x)

Description

all takes a single logical argument x and returns a logical value indicating whether or not all the elements of x are true.

The value returned is true if all the values in x are true, and false if x contains any false values. If x consists of a mix of true and NA values, then all returns NA.

Examples

if(all(x>0)) cat("All x values are positive\n")