is.allzero: Tests whether all elements are approximately zero

is.allzeroR Documentation

Tests whether all elements are approximately zero

Description

A single-line function that tests whether all elements are zero (approximately).

Usage

is.allzero(x)

Arguments

x

An object whose elements are to be tested.

Details

The mean of the absolute values of the elements of x is tested to determine if it is less than daeTolerance, which is initially set to .Machine$double.eps ^ 0.5 (about 1.5E-08). The function set.daeTolerance can be used to change daeTolerance.

Value

A logical.

Author(s)

Chris Brien

Examples

## create a vector of 9 zeroes and a one
y <- c(rep(0,9), 1)

## check that vector is only zeroes is FALSE 
is.allzero(y)

dae documentation built on June 22, 2024, 9:07 a.m.