Learn R Programming

pepr (version 0.5.0)

.expandPath: Expand system path

Description

This function expands system paths (the non-absolute paths become absolute) and replaces the environment variables (e.g, ${HOME}) with their values.

Usage

.expandPath(path)

Value

Expanded path or untouched string

Arguments

path

file path to expand. Potentially any string

Details

Most importantly strings that are not system paths are returned untouched

Examples

Run this code

string = "https://www.r-project.org/"
.expandPath(string)
path = "$HOME/my/path/string.txt"
.expandPath(path)

Run the code above in your browser using DataLab