# path.expand

0th

Percentile

##### Expand File Paths

Expand a path name, for example by replacing a leading tilde by the user's home directory (if defined on that platform).

Keywords
file
##### Usage
path.expand(path)
##### Arguments
path

character vector containing one or more path names.

##### Details

(These details are for Windows: the details differ on Unix.)

The definition of the ‘home’ directory is in the rw-FAQ Q2.14: it is taken from the R_USER environment variable when path.expand is first called in a session.

The ‘path names’ need not exist nor be valid path names but prior to R 3.4.0 they needed to be representable in the session encoding.

##### Value

A character vector of possibly expanded path names: where the home directory is unknown or none is specified the path is returned unchanged.

basename, normalizePath.
library(base) # NOT RUN { path.expand("~/foo") # }