Is the path a Windows drive?
Checks to see if the path is a Windows drive.
- A character vector of file paths. Defaults to files in the current directory.
A logical vector,
TRUEwhen the path is a Windows drive name. On non-Windows machines, the return value is
The check is done by regular expression: values are considered to be
Windows drive name if they consist of a letter followed by a colon,
optionally followed by a slash or backslash.
Paths are standardardized before checking, so
resolved to their actual locations rather than always returning
x <- c("c:", "c:/", "c:\\", "C:", "C:/", "C:\\", "c:/c", "cc:", NA) # Warnings about OS suppressed so package checks pass on non-Windows systems. suppressWarnings(is_windows_drive(x))