is_abs_path: Test if paths are relative or absolute

View source: R/paths.R

is_abs_pathR Documentation

Test if paths are relative or absolute

Description

On Unix, check if the paths start with ‘/’ or ‘~’ (if they do, they are absolute paths). On Windows, check if a path remains the same (via same_path()) if it is prepended with ‘./’ (if it does, it is a relative path).

Usage

is_abs_path(x)

is_rel_path(x)

Arguments

x

A vector of paths.

Value

A logical vector.

Examples

xfun::is_abs_path(c("C:/foo", "foo.txt", "/Users/john/", tempdir()))
xfun::is_rel_path(c("C:/foo", "foo.txt", "/Users/john/", tempdir()))

yihui/xfun documentation built on April 29, 2024, 12:16 p.m.