Description Functions See Also
The relatable
package provides two functions to safely map from a
vector of keys to a vector of values, determine properties of a given
relation, or ensure a relation conforms to a given type, such as
many-to-many, one-to-many, injective, surjective, or bijective. Permits
default return values for use similar to a vectorised switch statement, as
well as safely handling large vectors, NAs, and duplicate mappings.
relate
Returns a vector Y = F(X)
where F maps each element of input vector X
from its position
in vector A
to its corresponding position in vector B.
relation
Returns a function F that maps each
element of input vector X
from its position in vector A
to
its corresponding position in vector B.
For a quick introduction to the functions of the package see
"Basic Usage" with vignette("relatable-usage")
in R or
online
For instructions on how to use the additional arguments of
relate
and relation
see "Relation Types and Restrictions" with
vignette{"relatable-restrictions"}
in R or
online
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.