Compute relative path

rel_path(path, base = ".", windows = on_windows())

Arguments

path

Relative path

base

Base path

windows

Whether the operating system is Windows. Default value is to check the user's system information.

Examples

rel_path("a/b", base = "here")
#> [1] "here/a/b"
rel_path("/a/b", base = "here")
#> [1] "/a/b"