Macro extendr_api::call [−][src]
The call! macro calls an R function with Rust parameters.
Equivalent to lang!(sym, params).eval()
This returns a Rust Result.
Example:
use extendr_api::prelude::*; test! { let vec = call!("c", 1.0, 2.0, 3.0).unwrap(); assert_eq!(vec, r!([1., 2., 3.])); assert_eq!(vec.is_owned(), true); let list = call!("list", a=1, b=2).unwrap(); assert_eq!(list.len(), 2); let three = call!("+", 1, 2).unwrap(); assert_eq!(three, r!(3)); }