Bogaso Christofer wrote:> Hi, there is a function Skewness() under fBasics package. If I type > "skewness", I get followings: >Case matters in R, so please be precise.> > >> skewness > > function (x, ...) > > { > > UseMethod("skewness") > > } > > <environment: namespace:timeDate> > > > > Would be great if someone tell me how to see the codes of this function.That *is* the code of the function. There are then further methods used for specific classes, which is probably what you want to see. For instance, look at the code of summary vs. summary.lm . Try methods(skewness) to see which ones have been defined.> > > > 2ndly suppose I create following function: > > > > fn1 <- function(x) return(x+2) > > > > How I can make above kind of shape like, when user types "fn1" then he will > see: > > > > fn1 > > function(x,.) > > { > > UseMethod("fn1") > > }I don't know what this means. You just have to define you function that way. Use an actual text editor to write your functions, then send them to R.
Hi, there is a function Skewness() under fBasics package. If I type "skewness", I get followings:> skewnessfunction (x, ...) { UseMethod("skewness") } <environment: namespace:timeDate> Would be great if someone tell me how to see the codes of this function. 2ndly suppose I create following function: fn1 <- function(x) return(x+2) How I can make above kind of shape like, when user types "fn1" then he will see: fn1 function(x,.) { UseMethod("fn1") } .......... Etc. Thanks and regards, [[alternative HTML version deleted]]
I have the same question about how to see the process behind a function. If I type sample in R, it really tells nothing about how R selects from a data set and creates samples. Thank in advance for any help. ----- A R learner. -- View this message in context: http://r.789695.n4.nabble.com/How-to-see-inside-of-this-function-tp2289376p2289417.html Sent from the R help mailing list archive at Nabble.com.
Wu Gong wrote:> I have the same question about how to see the process behind a function. If I > type sample in R, it really tells nothing about how R selects from a data > set and creates samples. > > Thank in advance for any help. > > ----- > A R learner.Uwe Ligges. R Help Desk: Accessing the sources. R News, 6(4):43-45, October 2006. http://cran.r-project.org/doc/Rnews/ -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com