file.path {file} R Documentation

Construct Path to File

Description


Construct the path to a file from components in a
platform-independent way.

Usage

file.path(...,
    fsep = "/");

Arguments

x

character vectors. Long vectors are not supported.

fsep

the path separator to use (assumed to be ASCII). The components are by default separated by ‘/’ (not ‘\’) on Windows. [as string]

Details

The implementation is designed to be fast (faster than ‘paste’) as this Function is() used extensively In R itself. It can also be used for environment paths such as 'PATH’ and 'R_LIBS’ with ‘fsep = .Platform$path.sep’. Trailing Path separators are invalid For Windows file paths apart from '/’ and ‘d:/’ (although some functions/utilities do accept them), so a trailing '/’ or ‘\’ is removed there.

Authors

SMRUCC genomics Institute

Value

A character vector of the arguments concatenated term-by-term and separated by 'fsep’ if all arguments have positive length; otherwise, an empty character vector (unlike 'paste’).

An element Of the result will be marked (see 'Encoding’ as UTF-8 If run In a UTF-8 locale (When marked inputs are converted To UTF-8) Or if an component of the result Is marked as UTF-8, Or as Latin-1 in a non-Latin-1 locale.

clr value class

Examples


[Package file version 2.33.856.6961 Index]