dae (version 3.1-23)

is.allzero: 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.

Value

A logical.

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.

Examples

Run this code
# NOT RUN {
## 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)
# }

Run the code above in your browser using DataCamp Workspace