Expand description
Collection conversions (HashMap, BTreeMap, HashSet, BTreeSet) to R.
HashMap<String, V>/BTreeMap<String, V>→ named R listHashSet<T>/BTreeSet<T>→ unnamed R vector (via Vec intermediary)
§Tradeoff
Choose BTreeMap over HashMap when stable element order in the resulting
R list matters (testthat snapshots, deterministic file output) — HashMap
iteration order is unspecified and varies between runs. The same applies
to BTreeSet vs HashSet. Failure mode of using HashMap for a result
the user expect_equal()s by position: flaky tests across runs / R
versions.
Inbound counterpart: crate::from_r::collections.
Macros§
Functions§
- map_
to_ 🔒named_ list - Helper to convert an iterator of (String, V) pairs to a named R list.
- map_
to_ 🔒 ⚠named_ list_ unchecked - Unchecked version of
map_to_named_list.