R package anatomy

Open-source R Packages running in the TIBCO Enterprise Runtime for R engine are binary, and they must follow the standard package component design and contain version information.

The TIBCO Enterprise Runtime for R engine is designed to be highly compatible with the open-source R engine. To develop packages using open-source R, see its documentation, available on the Comprehensive R Archive Network (CRAN).

Note: Open-source R is available under separate open source software license terms and is not part of TIBCO Enterprise Runtime for R. As such, open-source R is not within the scope of your license for TIBCO Enterprise Runtime for R. Open-source R is not supported, maintained, or warranted in any way by TIBCO Software Inc. Download and use of open-source R is solely at your own discretion and subject to the free open source license terms applicable to open-source R.

A typical package is available as binary or source code. The TIBCO Enterprise Runtime for R engine supports only binary packages. You can install a binary or build a source package into a binary package and install it.

Note: The TIBCO Enterprise Runtime for R engine does not support building packages that contain a src directory.

Package components

A source package can contain any number of directories, including html (for the help index), libs, help, and so on. The simplest package requires the following files and directories:

File or Directory Description
mypkg The top-level directory name, which is also the package name (in this case, mypkg).
mypkg/NAMESPACE Required. You must specify the NAMESPACE.
mypkg/DESCRIPTION The file containing a description, the title, the author, date, the dialect, and version information, along with other information.
mypkg/R The directory containing *.R files with R language functions as ASCII files.
mypkg/R/mycode.R The R language code.

Your source package can also contain the following optional folders:

  • data directory containing data files in a dump format.
  • man directory containing help files in the .Rd help file format.
  • inst directory contains files and directories to be copied, recursively, into the main package directory when the package is compiled. Any informational files that the end user should see should be included in the inst directory. For example, if you have a PDF containing a vignette, you can include it in the inst/doc directory.
  • src directory, containing C, C++, or FORTRAN code.
  • tests directory can contain package-specific tests. This directory can contain test code (that is, .S, .ssc, .q, and .R).
    Note: The TIBCO Enterprise Runtime for R engine does not support the following:
    • Packages using graphics devices or containing graphics functions. (However; we have implemented stub functions to allow the non-graphical portions of many packages to run without error.)
    • Building packages with src directories. (If you use the TIBCO Enterprise Runtime for R engine to build a package containing a src directory, the src directory is ignored. If your built binary package contains a src directory, you can use it with the TIBCO Enterprise Runtime for R engine.)

Package versioning

Package version information is kept in the DESCRIPTION file. With every package revision, remember to revise the version number upward. This version number is an important part of your package management strategy.