Remove common part of two paths, leaving relative path

abs2rel(path, stempath = getwd(), StopIfNoCommonPath = FALSE)

Arguments

path

Paths to make relative

stempath

Root to which path will be made relative

StopIfNoCommonPath

Error if no path in common

Value

Character vector containing relative path

See also

Author

jefferis

Examples

path = "/Volumes/JData/JPeople/Sebastian/images"
abs2rel(path,'/Volumes/JData')
#> [1] "JPeople/Sebastian/images"