File: is_abs_path.Rd

package info (click to toggle)
r-cran-xfun 0.20-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 680 kB
  • sloc: ansic: 242; sh: 22; makefile: 2
file content (27 lines) | stat: -rw-r--r-- 724 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/paths.R
\name{is_abs_path}
\alias{is_abs_path}
\alias{is_rel_path}
\title{Test if paths are relative or absolute}
\usage{
is_abs_path(x)

is_rel_path(x)
}
\arguments{
\item{x}{A vector of paths.}
}
\value{
A logical vector.
}
\description{
On Unix, check if the paths start with \file{/} or \file{~} (if they do, they
are absolute paths). On Windows, check if a path remains the same (via
\code{xfun::\link{same_path}()}) if it is prepended with \file{./} (if it
does, it is a relative path).
}
\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()))
}