Learn R Programming

common (version 1.1.3)

Sys.path: Returns the path of the current program

Description

A function that gets the full path of the currently running program. If the function fails to retrieve the path for some reason, it will return a NULL. The function takes no parameters.

Usage

Sys.path()

Arguments

Value

The full path of the currently running program, or a NULL.

See Also

Other fileops: dir.find(), file.find(), source.all()

Examples

Run this code
# Get current path
pth <- Sys.path()
pth
# [1] "C:/programs/myprogram.R"

Run the code above in your browser using DataLab