Skip to main content

get_var_safe

Function get_var_safe 

Source
pub unsafe fn get_var_safe(symbol: SEXP, env: SEXP) -> Option<SEXP>
Expand description

Returns a variable from an environment, or None if unbound.

On R < 4.5, uses Rf_findVar and checks against R_UnboundValue. On R >= 4.5, uses R_getVar which signals an error if not found; callers should wrap this with catch_r_error if needed.

ยงSafety

This function dereferences raw SEXP pointers. The caller must ensure that symbol and env are valid SEXP pointers.