is_windows_drive(x)
TRUE
when the path is a Windows drive name.
On non-Windows machines, the return value is FALSE
everywhere.
get_drive
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))
Run the code above in your browser using DataLab