get_windows_drive: On Windows, return the drive of the path

Description Usage Arguments Value See Also Examples

View source: R/windows.R

Description

On a Windows system, this returns the drive letter of the path followed by a colon. On other systems, it returns a single forward slash.

Usage

1
2
3

Arguments

x

A character vector of file paths. Defaults to the current directory.

Value

A character vector of drive paths on Windows systems, or forward slashes on Unix-based systems.

See Also

is_windows_drive

Examples

1
2
 # often takes > 5s to run
get_windows_drive(c(".", "~", r_home(), temp_dir(), "\\\\foo/bar"))

richierocks/pathological documentation built on May 27, 2019, 8:47 a.m.