Skip to main content

Module expression

Module expression 

Source
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

TypePurpose
RSymbolInterned R symbol (SYMSXP)
RCallBuilder for R function calls (LANGSXP)
REnvWell-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.