
Last chance! 50% off unlimited learning
Sale ends in
systemFile(..., exec = FALSE, package = NULL, lib.loc = NULL)
systemDir(..., exec = FALSE, package = NULL, lib.loc = NULL)
exec = TRUE
, or subpath to
a file or dir in a package directory if package != NULL
, or a list of
path and subpaths for testing the existence of a file on disk, or a list of
directory components to retrieve in 'temp', 'sysTemp', 'user', 'home',
'bin', 'doc', 'etc' and/or 'share' to retrieve special system directories. TRUE
(default) search for executables on the search
path. It superseedes all other arguments. exec = FALSE
to search inside package dirs). NULL
(search all currently known libraries in this case). ""
if they are
not found, or of the wrong type (a dir for systemFile()
or or a file
for systemDir()
).
fileEdit
, file.path
, file.exists
systemFile("INDEX", package = "base")
systemFile("help", "AnIndex", package = "splines")
systemFile(package = "base") # This is a dir, not a file!
systemFile("zip", exec = TRUE)
systemFile("ftp", "ping", "zip", "nonexistingexe", exec = TRUE)
systemDir("temp") # The R temporary directory
systemDir("sysTemp") # The system temporary directory
systemDir("user") # The user directory
systemDir("home", "bin", "doc", "etc", "share") # Various R dirs
systemDir("zip", exec = TRUE) # Look for the dir of an executable
systemDir("ftp", "ping", "zip", "nonexistingexe", exec = TRUE)
systemDir(package = "base") # The root of the 'base' package
systemDir(package = "stats") # The root of package 'stats'
systemDir("INDEX", package = "stats") # This is a file, not a dir!
systemDir("help", package = "splines")
Run the code above in your browser using DataLab