clipout(X;Y;Z)
Returns NA if X is "in bounds",
that is, X>=Y or X<=Z. Otherwise,
clipout(X;Y;Z) returns X.
(Available as of version 18.37)
Syntax
clipout(X;Y;Z)
Input
| Argument | Type | Description |
|---|---|---|
X |
any simple type | The value to be "clipped out". |
Y |
any simple type | The minimum value. |
Z |
any simple type | The maximum value. |
Return Value
Returns NA if X>=Y or
X<=Z. Otherwise,
clipout(X;Y;Z) returns
X. clipout() is
the inverse of clip().
clipout(X;Y;Z) is the equivalent of
if(between(X;Y;Z);na;X).
Sample Usage
value |
min |
max |
clipout(value;min;max) |
|---|---|---|---|
| 2 | 1 | 3 | NA |
| 2 | 3 | 1 | 2 |
| 1.5 | 1 | 3 | NA |
| 1.5 | 2.5 | 3.1 | 1.5 |
| 1.5 | 1.2 | 3.1 | NA |
| 'bat' | 'bar' | 'baz' | NA |
| 'bag' | 'bar' | 'baz' | 'bag' |
| 'foo' | 'bar' | 'baz' | 'foo' |
| 3 | 'foo' | 'bar' | 3 |
| 3 | 4 | 'foo' | 3 |
