#include using namespace ROOT::R; void DataFrame() { //////////////////////// //creating variables// //////////////////////// TVectorD v1(3); std::vector v2(3); std::array v3{ {1,2,3} }; std::list names; ////////////////////// //assigning values// ////////////////////// v1[0]=1; v1[1]=2; v1[2]=3; v2[0]=0.101; v2[1]=0.202; v2[2]=0.303; names.push_back("v1"); names.push_back("v2"); names.push_back("v3"); TRInterface &r=TRInterface::Instance(); ///////////////////////////////////////////// //creating dataframe object with its labels// ///////////////////////////////////////////// TRDataFrame df1(Label["var1"]=v1,Label["var2"]=v2,Label["var3"]=v3,Label["strings"]=names); ////////////////////////////////////////////// //Passing dataframe to R's environment// ////////////////////////////////////////////// r["df1"]<>v4; //adding new colunm to df1 with name var4 df1["var4"]=v4; //updating df1 in R's environment r["df1"]<>df2; TVectorD v(3); df2["v1"]>>v; v.Print(); df2["v2"]>>v; v.Print(); /////////////////////////////////////////// //Working with colunms between dataframes// /////////////////////////////////////////// df2["v3"]<>df1["var1"]; //updating df1 in R's environment r["df1"]<