binary: Check for a binary array

binaryR Documentation

Check for a binary array

Description

This function checks whether a numeric array is binary, with only one unique nonzero value, or not.

Usage

binary(x)

Arguments

x

An object that can be coerced to a numeric array.

Value

A logical value indicating whether the array is binary or not. Binary in this case means that the array contains only one unique nonzero value, which is stored with the return value in an attribute.

Author(s)

Jon Clayden <code@clayden.org>


mmand documentation built on Feb. 16, 2023, 9:22 p.m.