filesstrings (version 0.4.0)

AllEqual: Check if all elements are equal.

Description

If one argument is specified, check that all elements of that argument are equal. If two arguments of equal length are specified, check equality of all of their corresponding elements. If two arguments are specified, a of length 1 and b of length greater than 1, check that all elements of b are equal to the element in a. If two arguments are specified, a of length greater than 1 and b of 1, check that all elements of a are equal to the element in b.

Usage

AllEqual(a, b = NULL)

Arguments

a

A vector.

b

Either NULL or a vector of length either 1 or length(a)

Value

TRUE if "equality of all" is satisfied (as detailed in "Description" above) and FALSE otherwise.

Examples

Run this code
AllEqual(1, rep(1, 3))
AllEqual(2, 1:3)
AllEqual(1:4, 1:4)
AllEqual(1:4, c(1, 2, 3, 3))
AllEqual(rep(1, 10))
AllEqual(c(1, 88))

Run the code above in your browser using DataCamp Workspace