Is there any way that I can see the step by step code for functions in the base package? For instance the dexp function. I am a student working on writing my own function for something that is similar to this dexp function and I would like to see the step by step code. Brittany Laine GTA WVU Statistics Department 331 Hodges
Benjamin.STABLER@odot.state.or.us
2004-May-13 20:39 UTC
[R] code for functions in base package
If you want to see the code (function definition) just type the function without any parenthesizes or arguments. In this case, the dexp function calls C code since the .Internal function is called. To see internal C code you have to look at the R source.> dexpfunction (x, rate = 1, log = FALSE) .Internal(dexp(x, 1/rate, log)) <environment: namespace:base> Benjamin Stabler Transportation Planning Analysis Unit Oregon Department of Transportation 555 13th Street NE, Suite 2 Salem, OR 97301 Ph: 503-986-4104>-----Original Message----- >From: Brittany Erin Laine [mailto:blaine at mix.wvu.edu] >Sent: Thursday, May 13, 2004 1:30 PM >To: R-help at stat.math.ethz.ch >Subject: [R] code for functions in base package > > >Is there any way that I can see the step by step code for functions in >the base package? For instance the dexp function. I am a student >working on writing my own function for something that is similar to >this dexp function and I would like to see the step by step code. > >Brittany Laine >GTA WVU Statistics Department >331 Hodges > >______________________________________________ >R-help at stat.math.ethz.ch mailing list >https://www.stat.math.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide! >http://www.R-project.org/posting-guide.html >
On 13 May 2004 at 16:30, Brittany Erin Laine wrote:> Is there any way that I can see the step by step code for functions in > the base package? For instance the dexp function. I am a student > working on writing my own function for something that is similar to > this dexp function and I would like to see the step by step code. >Then a useful way is to say debug(dexp) and then step through the code, thiugh I think that function rapidly disappears into internal C code.>From within a debug() session, tou can use ? (help)and other functions to investigate the objects, readinfg the help for function you see used, and so on. Kjetil Halvorsen> Brittany Laine > GTA WVU Statistics Department > 331 Hodges > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html >
For dexp() need to look at the C source code for R. It's part of the nmath library. -roger Brittany Erin Laine wrote:> Is there any way that I can see the step by step code for functions in > the base package? For instance the dexp function. I am a student > working on writing my own function for something that is similar to > this dexp function and I would like to see the step by step code. > > Brittany Laine > GTA WVU Statistics Department > 331 Hodges > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >
Hello My name is qamruz zaman and i want to see the codes of Kaplan meier and Bootstrap. Is it possible, if yes then please guide me step by step and also show me how to write my own functions. Bye
On Tue, May 25, 2004 at 05:22:44PM +0200, Qamruz Zaman wrote:> Hello > My name is qamruz zaman and i want to see the codes of Kaplan meier and > Bootstrap. Is it possible, if yes then please guide me step by step and > also show me how to write my own functions. > Bye > > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.htmlPlease read the posting guide, and the Introduction to R. It will provide a very detailed introduction to writing your own functions (and to R in general). Simply typing the function name at the R prompt will display the source code of the function (unless it was not exported, then use getAnywhere). Best, Tamas -- Tam??s K. Papp E-mail: tpapp at axelero.hu Please try to send only (latin-2) plain text, not HTML or other garbage.