[R] Howto view function's source code of an installed package

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Sep 28 22:31:51 CEST 2010


On Tue, 28 Sep 2010, Mark Miller wrote:

>
>
> I justed wanted to provide a description of how I was able to view source
> code of a function.
>
> First download the Program R package containing the function.  Specifically,
> download the file that ends in "tar.gz".  This is a compressed file.  Expand
> the compressed file using, for example, "WinZip".  Next open the
> uncompressed file that ends in ".tar".  I was able to open that file with
> the free software "7-Zip" available on the internet.  After installing that
> software I clicked on the file "7zFM.exe" and navigated to the directory
> containing the ".tar" file.  You can extract the contents of that ".tar"
> file into a new folder.  The contents consist of R files showing the source
> code for the functions in the R package.  These R files can be opened with a
> text editor.
>
> Hopefully, it is okay to mention other software here by name.  I have used
> the above method twice in the last few months to view source code for
> functions.  In both instances I needed a substantial amount of time to
> figure out how to do it.  This post might help others and perhaps will help
> myself in the future.

Why not just use the untar() function in package utils?  Since you 
appear to be on Windows (do study and follow the posting guide), using 
R is much the easiest.

>
> Mark W. Miller
>
> Gainesville, Florida
>
>
> -- 
> View this message in context: http://r.789695.n4.nabble.com/Howto-view-function-s-source-code-of-an-installed-package-tp831711p2717744.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org 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.
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list