plotr_utils: plotr utils

Description Usage Arguments Details See Also Examples

Description

Some utilities for plotr.

Usage

1
2
3
4
5
x %ni% table

x %inside% interval

a %||% b

Arguments

x

vector or NULL; the values to be matched

table

vector or NULL; the values to be matched against

interval

numeric vector of length two representing the interval

a, b

raw, logical, "number-like" vectors or objects

Details

%ni% is the negation of %in%.

%inside% returns a logical vector indicating if x is inside the interval (inclusive).

%||% is useful for a function, f, that may return a value or NULL, but if NULL is the result of f, it is desirable to return some other default value without errors.

See Also

%in%, ||

Examples

1
2
3
4
5
6
7
8
1:5 %ni% 3:5

c(0,4) %inside% c(0, 4)
-5:5 %inside% c(0, 5)
-5:5 %inside% c(5, 0)

# NULL || TRUE ## error
NULL %||% TRUE ## TRUE

raredd/plotr documentation built on Nov. 13, 2018, 7:05 a.m.