On 21 May 2014, at 22:31 , Helio Camargo <[email protected]> wrote:
> Sorry for the naive question, but is it actually possible do SEE the > approximation function y=f(x) in any of the output options of approxfun? Yes and no... > a <- approxfun(x, y, rule = 2:1) > a function (v) .approxfun(x, y, v, method, yleft, yright, f) <bytecode: 0x1159f1118> <environment: 0x1017ec630> > ls(environment(a), all=TRUE) [1] "f" "method" "x" "y" "yleft" "yright" > stats:::.approxfun function (x, y, v, method, yleft, yright, f) .Call(C_Approx, x, y, v, method, yleft, yright, f) <bytecode: 0x1155a91f0> and if you dig a little deeper, you find that the call to C_approx is also the content of approx() once all the initial "red tape" is peeled off. So the function is really not much different from a call to approx() using the arguments that were saved at the creation of the function. > > Cheers, > > -- > Helio > > [[alternative HTML version deleted]] > > ______________________________________________ > [email protected] mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. -- Peter Dalgaard, Professor, Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: [email protected] Priv: [email protected] ______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

