I am new using RDataFrame and I would like to clarify two questions:
Is there a way to get a graph with errors on the y-axis from a RDataFrame that contains x, y, and y-error in its columns? I have found examples with Graph but I would like to obtain a TGraphErrors for later fitting.
Can I retrieve the maximum range of the dataframe?
I am myself a rather inexperienced user, but in the RDataFrame Class reference is stated the function GraphAsymmErrors which has asymmetric errors, but these could be set to the same value to obtain your wanted result. As for the maximum range, I am not sure, what you mean. There is a function Max and Min which could give you the range of your data.
Hope this helps.
Thank you so much for your reply and for letting me know about the GraphAsymmErrors. Do you know how can I make the errors on x (exl, exh) to be zero? I don’t have errors on the x-axis and I don’t have any column in the dataframe for them.
I needed to get the total number of entries in the dataframe.
Thanks a lot!!
It seems that there is a problem with TGraphAsymmErrors from RDataFrame; ROOT says no member named 'GraphAsymmErrors' in 'ROOT::RDataFrame'.
Outside dataframe, you can just put zeroes where you want, e.g.
auto gr = new TGraphAsymmErrors(n,x,y,0,0,eyl,eyh);
but for RDataFrame the documentation says you should give a string (name of column), so if zero doesn’t work I suppose you could just use any column minus itself (e.g. TGraphAsymmErrors("x","y","x-x","x-x","eyl","eyh")), or define a column with that difference and use that column for zero errors.
I’m very late to the party, but just to clarify: GraphAsymmErrors is still unreleased: it’s present in the master branch (and therefore our nightly builds and it will be released with the upcoming ROOT v6.28.
In the meanwhile you might be able to emulate it by creating a TGraphAsymmErrors manually and passing it to RDataFrame’s Fill method.