Skip to content

relatable

1.0.0Package record

Functions for Mapping Key-Value Pairs, Many-to-Many, One-to-Many, and Many-to-One Relations

0packages depend
2.1Kdownloads / year
96.7%test coverage
13/13flavors OK

Overview

About

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.

Changes in 1.0.0

Features

relatable provides two easy-to-use, robust functions for mapping from

a vector of keys to a vector of values, as well as creating and applying

more sophisticated mappings, such as many-to-many, one-to-many, and

many-to-one relations. These are primarily designed with two goals in

mind:

1. Producing reusable code that is easier to write and read.

2. Ensuring relations conform to specified restrictions, for example

injectivity or surjectivity, and safely handle nonstandard mappings,

including unexpected inputs, NAs, heterogeneous lists containing

multiple variable types including other lists, and mappings between

vectors of uncertain or unequal lengths.

Show all changes in 1.0.0Hide the rest of the changes in 1.0.0

Functions

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. Can be applied as a vectorised key-value

dictionary with an optional default return value. Additional options

restrict mapping types so relation *F* must be a function, injective,

surjective, etc.

relation returns a reusable function *F* that performs the same

operation as relate. In addition to providing a reusable function, if

handle_duplicate_mappings = TRUE, relation checks for and eliminates

duplicate mappings that would be invalid inputs for relate. If

report_properties = TRUE, relation also prints the restrictions the

mapping from A to B conforms to.

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 1.1 min · r-oldrel-windows-x86_64
Status changes
  • OK13 OK2026-08-05
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK14 OK2026-03-10
Advisories

none known

Documentation

In release 1.0.0
READMEYes · 282 wordsVignettesYes · 1 · dynamicNEWSYes · 33% structured · mentions 1.0.0Citation fileNoWebsitenot declared in DESCRIPTION
Help pages
2
Examples that run
100%1 run in a plain check
Exported functions with examples
100%
Documented parameters
100%
Return-value docs
0%
Help pages citing references
0%
Vignettes (1)

Downloads

2.1K
CRAN downloads in the past year
Rank #23,136 · ~6/day · ~176/mo
Daily download trend is not available in this view yet.
19730 days
57090 days
2.1K1 year
Compare downloads with other packages →
Also on68 r2u3 autocran

Repository

2Stars
0Forks
0Open issues
0Open PRs
0Releases
66Commits
1Commit identities
66 commits · Last activity 2018-02-01 · 0% stars, 30d · Default branch at 1.0.0.9000, ahead of CRAN 1.0.0 (checked 2026-10-21)
Responsiveness
not measured

Stars over time

2018-01-30 · 22026-07-07 · 2
PracticesBeta

3 development-tooling and community-health practices detected across 3 families in the upstream repository

Checks run against github.com/domjarkey/relatable on 2026-10-21.

Docs source (1)
README.Rmd
CRAN release process (1)
cran-comments.md
Lint, format, editor (1)
RStudio project
How this is detected·Detection ruleset v4 (2026-10-20)

Dependencies

Declared dependencies
5 external dependencies (excludes base and recommended)

Installing relatable adds 1 package (0 with compiled code, 399 KB of source tarballs). Heaviest: compare 399 KB.

Depends (1)
R >= 3.4
Imports (1)
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

Datasets

People & History

People (1)
Author, Maintainer since 1.0.0 (2018)
Releases (1)
  • R
    R 4.6.0 released · 2026-04-24
  • R
    R 4.5.0 released · 2025-04-11
  • R
    R 4.4.0 released · 2024-04-24
  • R
    R 4.3.0 released · 2023-04-21
  • R
    R 4.2.0 released · 2022-04-22
  • R
    R 4.1.0 released · 2021-05-18
  • R
    R 4.0.0 released · 2020-04-24
  • R
    R 3.6.0 released · 2019-04-26
  • R
    R 3.5.0 released · 2018-04-23
  • 1.0.0Latest
    2018-01-30 · current release
  • R
    R 3.4.0 released · 2017-04-21

Package metadata

First published
2018-01-30
Total releases
1 / 8 yrs
License
MIT + file LICENSE OSI
Minimum R
≥ 3.4
Bundled data
1.2 KB / 1 file
Download size
60 KB

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("relatable")
Jarkey, D. (2018). relatable: Functions for Mapping Key-Value Pairs, Many-to-Many, One-to-Many, and Many-to-One Relations (Version 1.0.0) [Computer software]. https://doi.org/10.32614/CRAN.package.relatable

This package has no citation file, so citation() returns this entry built from DESCRIPTION.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for relatable version 1.0.0 [Data set]. HJJB, LLC. Data release v2026-10-25. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-25, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy