splitMyDir: Split the path of a directory

Description Usage Arguments Value Author(s) Examples

View source: R/splitMypath.R

Description

A helper function that splits the path of a direcory based on either the '\\' or '/'.

Usage

1

Arguments

Dir

The path name of a directory

Value

A list of folder names, with the lowest nested folder occuring first, and returns the reverse order of the directory such that the lowest level is first.

Author(s)

P. A. Harrison

Examples

1
2
3
4
5
6
7
8
9
# Example using '\'
tmp <- "C:\\Test\\Test1\\test2\\test3"
PUCA::splitMyDir(Dir = tmp)
# [1] "test3" "test2" "Test1" "Test"  "C:"   

# Example using '/'
tmp <- "C:/Test/Test1/test2/test3"
PUCA::splitMyDir(Dir = tmp)
# [1] "test3" "test2" "Test1" "Test"  "C:" 

peteraharrison/PUCA documentation built on Sept. 16, 2019, 7:56 a.m.