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.
Re-exports§
use std::collections::BTreeMap;🔒use std::collections::BTreeSet;🔒use std::collections::HashMap;🔒use std::collections::HashSet;🔒use std::hash::Hash;🔒use std::hash::Hash;🔒use crate::SexpExt;🔒use crate::into_r::IntoR;🔒use crate::into_r::str_to_charsxp;🔒use crate::into_r::str_to_charsxp_unchecked;🔒
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.