closest: Return closest value

Description Usage Arguments Examples

Description

An internal function not intended for the user. Given a number x and vector of permitted values, returns the closest permitted value to x (in absolute value).

Usage

1
closest(x, candidates)

Arguments

x

The number to be compared to the permitted values.

candidates

A vector of permitted values.

Examples

1
closest( x = 5, candidates = c(-3, 8, 25) )

SimTimeVar documentation built on May 2, 2019, 8:31 a.m.