Find a file in a package
system.file that returns standardized paths.
system_file(..., package = "base", library_location = NULL, must_work = FALSE, sep = c("/", "\\"))
- Character vectors specifying subdirectories and files within some package. The default, none, returns the root of the package. Wildcards are not supported.
- A string with the name of a single package. An error occurs if more than one package name is given.
- a character vector with path names of R libraries.
See the 'Details section of
system.filefor the meaning of the default value of NULL.
TRUE, an error is given if there are no matching files.
- String separator between directory levels in the output.
A character vector of positive length, containing the file paths that
..., or a missing string,
NA, if none matched (unless
mustWork = TRUE). (This behaviour for missing paths differs from
system.file.) If matching the root of a package, there is no trailing separator. system.file() with no arguments gives the root of the base package.
# Examples taken from ?system.file system_file() # The root of the 'base' package system_file(package = "stats") # The root of package 'stats' system_file("INDEX") system_file("help", "AnIndex", package = "splines")
Looks like there are no examples yet.