Test if paths are relative or absolute
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
xfun::same_path()
) if it is prepended with ‘./’ (if it
does, it is a relative path).
is_abs_path(x) is_rel_path(x)
x |
A vector of paths. |
A logical vector.
xfun::is_abs_path(c("C:/foo", "foo.txt", "/Users/john/", tempdir())) xfun::is_rel_path(c("C:/foo", "foo.txt", "/Users/john/", tempdir()))
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.