[R] How to see a R function's code

Uwe Ligges ligges at statistik.tu-dortmund.de
Sun Mar 8 10:36:19 CET 2015



On 08.03.2015 02:45, Jeff Newmiller wrote:
> Most (perhaps all) packages are byte-compiled now. You can often see decompiled code by entering the name of the function without parentheses, or using the getAnywhere function. For base R functions you should probably download the R source tar file separately and unpack it to a convenient location of your choice and dig in.
> ---------------------------------------------------------------------------
> Jeff Newmiller                        The     .....       .....  Go Live...
> DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
>                                        Live:   OO#.. Dead: OO#..  Playing
> Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
> /Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
> ---------------------------------------------------------------------------
> Sent from my phone. Please excuse my brevity.
>
> On March 7, 2015 2:52:51 PM PST, TeeJay <tommesmcpommes at gmx.net> wrote:
>> Hi there,
>>
>> I know this is quite an old post but I am wondering if the answer still
>> applies!?
>>
>> I would like to access the boxplot function. So, I tried to follow the
>> instruction of Uwe Ligges’s article  “Accessing the Sources”
>> <http://cran.r-project.org/doc/Rnews/Rnews_2006-4.pdf>  . However, in
>> “$RHOME/src/library/” there is no graphics folder!

Just unpack the R sources and it is there.

Best,
Uwe Ligges


At this location I
>> only
>> have a “windlgs” folder. I have a graphics folder in “$RHOME/library/”
>> though. But I am not able to find a “plot.R” in any of the subfolders
>> as
>> mentioned in Uwe’s article.
>>
>> Furthermore, if I debug into the boxplot function in RStudio, I get a
>> warning stating “Debug location is approximate because the source is
>> not
>> available”.
>>
>> I already tried to reinstall R but that also did not add the “graphics”
>> folder to the “src” folder. Any ideas are appreciated a lot!
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://r.789695.n4.nabble.com/How-to-see-a-R-function-s-code-tp4380111p4704296.html
>> Sent from the R help mailing list archive at Nabble.com.
>>
>> ______________________________________________
>> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> 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.
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.
>



More information about the R-help mailing list