powered by
This is an inverse of path.expand(), which replaces the home directory or project directory with a tilde.
path.expand()
path.abbrev(path, dir = fs::path_wd())
Abbreviated file paths.
Character vector containing one or more full paths.
The directory to replace with ~. Defaults to fs::path_wd().
~
fs::path_wd()
print(fs::path_wd("test")) path.abbrev(fs::path_wd("test"))
Run the code above in your browser using DataLab