Expand description
Safe wrappers for R expression evaluation.
This module provides ergonomic types for building and evaluating R function calls from Rust, handling GC protection and error propagation automatically.
§Types
| Type | Purpose |
|---|---|
RSymbol | Interned R symbol (SYMSXP) |
RCall | Builder for R function calls (LANGSXP) |
REnv | Well-known R environments |
§Example
ⓘ
use miniextendr_api::expression::{RCall, REnv};
unsafe {
// Call paste0("hello", " world") in the base environment
let result = RCall::new("paste0")
.arg(Rf_mkString(c"hello".as_ptr()))
.arg(Rf_mkString(c" world".as_ptr()))
.eval(REnv::base().as_sexp())?;
}Structs§
- RCall
- Builder for constructing and evaluating R function calls.
- REnv
- Handle to a well-known R environment.
- RSymbol
- A safe wrapper around R symbols (SYMSXP).
Functions§
- get_
r_ 🔒 ⚠error_ message - Extract the most recent R error message.