Learn R Programming

nat.utils (version 0.6.1)

abs2rel: Remove common part of two paths, leaving relative path

Description

Remove common part of two paths, leaving relative path

Usage

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

Value

Character vector containing relative path

Arguments

path

Paths to make relative

stempath

Root to which path will be made relative

StopIfNoCommonPath

Error if no path in common

Author

jefferis

See Also

path.expand, normalizePath

Other path_utils: common_path(), split_path()

Examples

Run this code
path = "/Volumes/JData/JPeople/Sebastian/images"
abs2rel(path,'/Volumes/JData')

Run the code above in your browser using DataLab