Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

path

Construct path to a file or directory


Description

path() constructs a relative path, path_wd() constructs an absolute path from the current working directory.

Usage

path(..., ext = "")

path_wd(..., ext = "")

Arguments

...

character vectors, if any values are NA, the result will also be NA. The paths follow the recycling rules used in the tibble package, namely that only length 1 arguments are recycled.

ext

An optional extension to append to the generated path.

See Also

path_home(), path_package() for functions to construct paths relative to the home and package directories respectively.

Examples

path("foo", "bar", "baz", ext = "zip")

path("foo", letters[1:3], ext = "txt")

fs

Cross-Platform File System Operations Based on 'libuv'

v1.5.0
GPL-3
Authors
Jim Hester [aut, cre], Hadley Wickham [aut], libuv project contributors [cph] (libuv library), Joyent, Inc. and other Node contributors [cph] (libuv library), RStudio [cph, fnd]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.