Learn R Programming

ox (version 0.1.0)

OX_default: Utility function to run OX

Description

Utility function to run OX

Usage

OX_default(
  .f,
  ...,
  .then = list(...)[[1]],
  .else = rev(list(...))[[1]],
  .invert = FALSE
)

Arguments

.f

(function) evaluated as .f(...). Must return a vector of indices (logical or integer), which defines which values will be replaced by .else.

...

arguments passed to the .f.

.then

(list, atomic, NULL) A positive-replacement. NOTE, that if .then is not specified directly by named argument then the first argument from ... will be taken.

.else

(list, atomic, NULL) A negative-replacement. Should be of length equal to length of .then, or single value or NULL. NOTE, that if .else is not specified directly by named argument then the last argument from ... will be considered as a replacement.

.invert

(logical(1)) whether to invert the indices