28 r<<
"options(device='pdf')";
33 TRObject xdata =
c(-2,-1.64,-1.33,-0.7,0,0.45,1.2,1.64,2.32,2.9);
34 TRObject ydata =
c(0.699369,0.700462,0.695354,1.03905,1.97389,2.41143,1.91091,0.919576,-0.730975,-1.42001);
41 TRObject fit = nls(asformula(
"ydata ~ p1*cos(p2*xdata) + p2*sin(p1*xdata)"),
Label[
"data"]=data,
Label[
"start"]=list(
Label[
"p1"]=1,
Label[
"p2"]=0.2));
46 devnew(
"Fitting Regression");
50 lines(xgrid,predict(fit,xgrid),
Label[
"col"] =
"green");
51 devoff(
Label[
"which"] = devcur() );
static Vc_ALWAYS_INLINE int_v min(const int_v &x, const int_v &y)
void plot(TString fname="data.root", TString var0="var0", TString var1="var1")
This is a class to get ROOT's objects from R's objects
This is a class to pass functions from ROOT to R.
void SetVerbose(Bool_t status)
Method to set verbose mode, that produce extra output.
static TRInterface & Instance()
static method to get an TRInterface instance reference
static Vc_ALWAYS_INLINE int_v max(const int_v &x, const int_v &y)
Rcpp::internal::NamedPlaceHolder Label
This is a class to create DataFrames from ROOT to R