11 std::cout <<
"======Getting values from R ======\n";
12 TString s = gR->ParseEval(
"'ROOTR'");
15 std::vector<Double_t> sv=gR->ParseEval(
"c(1.01,2,3,4)");
16 TMatrixD m = gR->ParseEval(
"matrix(c(1,2,3,4),2,2)");
18 std::cout<<
"-----------------------------------"<<endl;
19 std::cout << s << std::endl;
20 std::cout<<
"-----------------------------------"<<endl;
22 std::cout<<
"-----------------------------------"<<endl;
23 for(
int i=0;i<sv.size();i++) std::cout<<sv[i]<<
" "<<std::endl;
24 std::cout<<
"-----------------------------------"<<endl;
29 Int_t i = gR->ParseEval(
"1");
31 std::cout << d <<
" " << f <<
" " << i << std::endl;
37 std::cout <<
"======Passing values to R ======\n";
39 gR->Parse(
"print(s)");
40 std::cout<<
"-----------------------------------"<<endl;
43 gR->Parse(
"print(v)");
44 std::cout<<
"-----------------------------------"<<endl;
47 gR->Parse(
"print(sv)");
48 std::cout<<
"-----------------------------------"<<endl;
51 gR->Parse(
"print(m)");
52 std::cout<<
"-----------------------------------"<<endl;
55 gR->Parse(
"print(d)");
56 std::cout<<
"-----------------------------------"<<endl;
59 gR->Parse(
"print(f)");
60 std::cout<<
"-----------------------------------"<<endl;
63 gR->Parse(
"print(i)");
static TRInterface * InstancePtr()
static method to get an TRInterface instance pointer
void Print(Option_t *option="") const
Print the vector as a list of elements.
static ROOT::R::TRInterface * gR
void Assign(const T &var, const TString &name)
Template method to assign C++ variables into R enviroment.
void SetVerbose(Bool_t status)
Method to set verbose mode, that produce extra output.
static constexpr double s
void Print(Option_t *name="") const
Print the matrix as a table of elements.