path_rel: Relative filepath from a path to another

Description Usage Arguments Examples

View source: R/rel.R

Description

Return a relative filepath to another path, either from the current directory or from an optional start directory. This is a path computation: the filesystem is not accessed to confirm the existence or nature of path or start.

Usage

1
path_rel(path, start = ".")

Arguments

path

Character vector of paths.

start

Start directory, character scalar. Defaults to the current working directory.

Examples

1
2
3
path_rel("./bar/foo/bar", "/")
path_rel("./bar/foo/bar", "bar/baz/ize")
path_rel("./bar/foo/bar", "../../")

richfitz/pathr documentation built on May 27, 2019, 8:22 a.m.