next up previous contents index
Next: Emacs Speaks Statistics (ESS) Up: Build R Package Previous: Documenting Data Sets   Contents   Index

Compile the Package

You must have at least one Rd files in your man directory. If you just wish to test if you can compile a package, but have not got any documentations written yet, simply create a file called, say, test.Rd, and put it in the man directory. Once you are ready to compile the package, open a DOS-prompt under Windows, then cd into the parent directory of foo, and type:
Rcmd build --binary foo
Or if you wish:
Rcmd build --binary --use-zip foo
which will zip your data sets and help files. Either command will produce a foo_*.zip, where * is the version of the package5.3. This file is a compiled package, which can be installed directly into R (Section 2.2). Now, with the first command, once you installed your library, which by default is installed in $R_HOME\library\mypack, you will notice that under the data and help sub-directories, the files are un-zipped. With the second line up there, i.e. with the -use-zip parameter, both the data and help sub-directories will show a zipped file in each of them. For example, take a look at $R_HOME\library\base. Under its data and help sub-directories, you will see a zip file. To make it more clear, in the command prompt window (I assume you already have $R_HOME\bin in your PATH), type:
Rcmd build --help
you will then see that with the
Rcmd build --binary --use-zip-data
foo will produce a package such that, after installed, ALL the data files in the data sub-directories will be in a zip file. On the other hand, with
  Rcmd build --binary --use-zip-help
will put all the files in the help sub-directory into a zip file. Finally, with
  Rcmd build --binary --use-zip
is a combination of the above two. It is usually a good idea to do -use-zip to save disk space. Under the Windows environment it is not too uncommon to have folders with spaces in their names, e.g. C:\Program Files\. However when you try to compile your package, these spaces may give you problems. Therefore it is recommended, from my experience, that you copy the entire package folder (e.g. foo) into a folder that does not have any spaces in its name, e.g. C:\Temp\.
next up previous contents index
Next: Emacs Speaks Statistics (ESS) Up: Build R Package Previous: Documenting Data Sets   Contents   Index
Ko-Kang Wang 2002-10-10