Macro extendr_api::R[][src]

macro_rules! R {
    ($($t:tt)*) => { ... };
}

Call inline R source code from Rust.

Multiline expressions and variables with embedded "." may not work. Note that the performance of this function is not good.

use extendr_api::prelude::*;
test! {

let formula = R!(y ~ z + 1).unwrap();
assert!(formula.inherits("formula"));

let function = R!(function(x,y) x+y).unwrap();
assert!(function.is_function());
}