path.abbrev: Abbreviate a file path

View source: R/path-abbrev.R

path.abbrevR Documentation

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())

Arguments

path

Character vector containing one or more full paths.

dir

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

Value

Abbreviated file paths.

Examples

print(fs::path_wd("test"))
path.abbrev(fs::path_wd("test"))

irworkshop/campfin documentation built on Oct. 19, 2023, 8:02 a.m.