Learn R Programming

this.path (version 2.5.0)

path.functions: Constructs Path Functions Similar to 'this.path()'

Description

path.functions() accepts a pathname and constructs a set of path-related functions, similar to this.path() and associated.

Usage

path.functions(file, local = FALSE, n = 0,
               envir = parent.frame(n + 1),
               matchThisEnv = getOption("topLevelEnvironment"),
               srcfile = if (n) sys.parent(n) else 0)

Value

An environment with at least the following bindings:

this.path

Function with formals (original = FALSE, contents = FALSE) which returns the normalized file path, the original file path, or the contents of the file.

this.dir

Function with no formals which returns the directory of the normalized file path.

here

Function with formals (..., .. = 0) which constructs file paths, starting with the file's directory.

this.proj

Function with formals (..., .. = 0) which constructs file paths, starting with the project root.

rel2here, rel2proj

Functions with formals (path) which turn absolute paths into relative paths, against the file's directory / / project root.

LINENO

Function with no formals which returns the line number of the executing expression in file.

Arguments

file

a character string giving the pathname of the file or URL.

local, n, envir, matchThisEnv, srcfile

See ?this.path().