Skip to contents

Split a path into its components in a platform-independent way. These components can then be used for reconstructing the path on a different platform.

Usage

get_path_components(path)

Arguments

path

The path from which to separate out components. This can be with unix-style or windows-style separators.

Value

A character vector of the path components from the given path.

Examples

linux_path_1 <- "/path/to-somewhere/else"
linux_path_2 <- "path/to somewhere/else"
linux_path_3 <- "/path/to somewhere/else"
windows_path_1 <- "C:\\Path\\to somewhere\\else"
windows_path_2 <- "Path\\to somewhere\\else"