Learn R Programming

campfin (version 1.0.11)

path.abbrev: Abbreviate a file path

Description

This is an inverse of path.expand(), which replaces the home directory or project directory with a tilde.

Usage

path.abbrev(path, dir = fs::path_wd())

Value

Abbreviated file paths.

Arguments

path

Character vector containing one or more full paths.

dir

The directory to replace with ~. Defaults to fs::path_wd().

Examples

Run this code
print(fs::path_wd("test"))
path.abbrev(fs::path_wd("test"))

Run the code above in your browser using DataLab