Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

split_path

Split a File Path into Components


Description

This function converts a character scalar containing a valid file path into a character vector of path components (e.g. directories).

Usage

split_path(x, depth_first = TRUE)

Arguments

x

character scalar. Path to be processed.

depth_first

logical. Should path be returned depth first? Defaults to TRUE.

Value

Character vector of path components, depth first.

Examples

longPath = "/users/me/src/this/is/a/long/path"
    split_path(longPath)

gtools

Various R Programming Tools

v3.8.2
GPL-2
Authors
Gregory R. Warnes, Ben Bolker, and Thomas Lumley
Initial release
2020-03-23

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.