relpath: returns a relative path

Description Usage Arguments Details Value Examples

View source: R/rbsa4.code.r

Description

returns the relative path associated to pto starting from pfrom; both paths being supposed to be defined from the same point; possibly the / one.

Usage

1
2
 
  relpath(pfrom,pto) 

Arguments

pfrom

Starting path.

pto

Target path. Must not comprise any ../ component.

Details

Seems compulsory to forbid ../ components into pto

Value

A character with the computed path.

Examples

1
2
3
 
  relpath("A/B/C/D/","A/B/Q/R/"); 
  relpath("../../../../","A/B/Q/R/"); 

rbsa documentation built on May 2, 2019, 6:07 p.m.