Find Names of S-PLUS System Files

DESCRIPTION:

Find the full names of files in packages, libraries or modules.

USAGE:

system.file(..., package=NULL, lib.loc=NULL)

OPTIONAL ARGUMENTS:

...
character strings, specifying the names of files or directories within a package. Subdirectories can be given as part of a name, for example, "examples/first.txt". If no names are given, then the root of the package is returned. Wildcard characters in the names are not supported.
package
a character string specifying the name of a package, library, or module. If NULL (the default), the top-level SHOME directory is assumed. This default is different from R, where the default is the "base" package.
lib.loc
a character vector with path names of directories containing S-PLUS or R libraries or packages. If this argument is non-NULL, then only those directories are searched for the specified package. The default value of 'NULL' corresponds to all libraries currently known. If the default is used, the loaded packages are searched before the libraries.

VALUE:

A character vector of positive length, containing the full names for the ... arguments, or the empty string, "", if none were found.

If no ... arguments are given, the returned value is the full path to the directory of the package specified by the package argument.

DETAILS:

This function returns the full path to a file or directory in a package (library, module, or chapter). Given the name of the package and the name of the file, it finds the path to the package and tacks the file name onto it. The full name is returned if the files exists.

Both attached and unattached libraries are searched, looking in all the places library() or module() would look unless the lib.loc argument is given. The package directory must contain a "DESCRIPTION" file or a ".Data" subdirectory.

This function emulates R's system.file function, but the default value of the package argument differs, so that calling the function with no arguments, system.file() , gives a different result.

SEE ALSO:

,

EXAMPLES:

  
file.show(system.file("README", package="pkgutils"), pager="cat")
  
list.files(file.path(system.file(), "doc"))