11 std::cout <<
"======Getting values from R ======\n";
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;
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 ROOT::R::TRInterface * gR
ROOT R was implemented using the R Project library and the modules Rcpp and RInside
void SetVerbose(Bool_t status)
Method to set verbose mode, that produce extra output.
void Assign(const T &var, const TString &name)
Template method to assign C++ variables into R environment.
static TRInterface * InstancePtr()
static method to get an TRInterface instance pointer