[R] src directory disappeared after installation of packages

Thomas Lumley tlumley at u.washington.edu
Wed Nov 21 23:11:41 CET 2001


On Wed, 21 Nov 2001, Jonathan Li wrote:

> Hi,
>
> I am using R on Debian Linux. I tried to install packages from inside R
> by calling
> function install.packages(), e.g., install.packages("tree"). The
> packages were
> installed successfully. However, I couldn't find the "src" subdirectory
> under the /usr/lib/R/library/tree directory,, which is supposed to
> contain the C, C++ and FORTRAIN source files, according to the "Writing
> R Extensions" page 4.
> By looking at tree.R by BDR, I know that src is supposed to have files
> such as BDRgrow1.c in it.
>
> Did I look in a wrong directory or are there something wrong with the
> way I use "install.packages()"?
> Your insights are highly appreciated.


An installed package doesn't have a src directory. Under Linux,
install.packages() downloads and compiles the package and puts the
resulting binary in $R_HOME/library.  You have the option of whether to
delete the source package (a .tar.gz file). If you didn't it should be
in a subdirectory whose name begins with "Rinstdir", in your TMPDIR
(probably either ~/tmp or /tmp)

There seems to be confusion from time to time about the difference between
source packages (found on CRAN in /src/contrib/) and binary packages
(found on CRAN in bin/<operating system>/contrib or in your
$R_HOME/library directory).  As with some other R topics, it's not that it
isn't documented, but it may not be obvious where to look.


Source package:
src/
	lots of .c and .f files
R/
	lots of .R (or .s or .q) files
man/
	lots of .Rd files


Installed package (or binary package for Windows):
libs/
	A shared library
R/
	A single file with no .R extension
help/
	help pages
latex/
	latex help
html/
	html help
R-ex/
	examples from help pages


	-thomas

Thomas Lumley			Asst. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list