Movatterモバイル変換


[0]ホーム

URL:


rdrr.io

system.file: Find Names of R System Files

system.fileR Documentation

Find Names of R System Files

Description

Finds the full file names of files in packages etc.

Usage

system.file(..., package = "base", lib.loc = NULL,            mustWork = FALSE)

Arguments

...

character vectors, specifying subdirectory and file(s)within some package. The default, none, returns theroot of the package. Wildcards are not supported.

package

a character string with the name of a single package.An error occurs if more than one package name is given.

lib.loc

a character vector with path names ofR libraries.See ‘Details’ for the meaning of the default value ofNULL.

mustWork

logical. IfTRUE, an error is given if thereare no matching files.

Details

This checks the existence of the specified files withfile.exists. So file paths are only returned if thereare sufficient permissions to establish their existence.

The unnamed arguments in... are usually character strings, butif character vectors they are recycled to the same length.

This usesfind.package to find the package, and hencewith the defaultlib.loc = NULL looks first for attachedpackages then in each library listed in.libPaths().Note that if a namespace is loaded but the package is not attached,this will look only on.libPaths().

Value

A character vector of positive length, containing the file pathsthat matched..., or the empty string,"", if nonematched (unlessmustWork = TRUE).

If matching the root of a package, there is no trailing separator.

system.file() with no arguments gives the root of thebase package.

See Also

R.home for the root directory of theRinstallation,list.files.

Sys.glob to find paths via wildcards.

Examples

system.file()                  # The root of the 'base' packagesystem.file(package = "stats") # The root of package 'stats'system.file("INDEX")system.file("help", "AnIndex", package = "splines")

What can we improve?

R Package Documentation

Browse R Packages

We want your feedback!

Note that we can't provide technical support on individual packages. You should contact the package authors for that.

 
Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, readEmbedding Snippets.

Close

[8]ページ先頭

©2009-2026 Movatter.jp