Expand description
Large integer types → REALSXP (f64).
R doesn’t have native 64-bit integers. These types convert to f64 (REALSXP) which may lose precision for values outside the “safe integer” range.
§Tradeoff
These are the lax outbound impls — values in (i32::MIN, i32::MAX]
become INTSXP and everything else silently widens to REALSXP, with
precision loss above 2^53. The strict alternative is
crate::strict::checked_into_sexp_i64 (and the u64/isize/usize
siblings), reached via #[miniextendr(strict)] — those panic (→ R error)
instead of widening. Failure mode of staying on the lax path with
IDs/counters: collisions once values exceed 2^53 (≈ 9 × 10^15).
For storage-directed conversions (force INTSXP, error if out of range)
see crate::into_r_as::IntoRAs.
Macros§
- impl_
logical_ 🔒into_ r - Macro for logical IntoR via Rf_ScalarLogical with conversion to i32.
- impl_
option_ 🔒coerce_ into_ r - Macro for
Option<T>whereTcoerces to a type with existing Option impl. - impl_
option_ 🔒smart_ i64_ into_ r - Macro for NA-aware
Option<T> → Rsmart scalar conversion. Checks if value fits i32 → INTSXP with NA_INTEGER for None, otherwise REALSXP with NA_REAL for None.
Functions§
- str_
to_ 🔒charsxp - Helper to convert a string slice to R CHARSXP. Uses UTF-8 encoding. Empty strings return R_BlankString (static, no allocation).
- str_
to_ 🔒 ⚠charsxp_ unchecked - Unchecked version of
str_to_charsxp. - vec_
externalptr_ 🔒to_ list - Allocate a VECSXP and populate it with the external pointers in
items. - vec_
option_ 🔒externalptr_ to_ list - As
vec_externalptr_to_list, butNoneelements becomeNULL.