extract_path: Extract Parts of a Path

Description Usage Arguments Value Examples

Description

Extract portions of a path.

Usage

1
extract_path(x, n = 1, fun = head, inds = NULL)

Arguments

x

A vector of path(s).

n

Corresponds to n in head & tail. Gives 1 to n of the beginning (fun = head) or end (fun = tail) of string. Note this is over rode if inds is supplied.

fun

Either the head or tail function.

inds

An index of elements of the path to use (for when you don't want to include beginning or end of the path).

Value

Returns a partial path(s).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
extract_path(x)
extract_path(x, 2)
extract_path(x, -2)
extract_path(x, fun=tail)
extract_path(x, 2, fun=tail)
extract_path(x, inds=2:3)
x <- c(
    "C:/Users/trinker/Desktop/commencement_project",
    "C:\\Users\\trinker\\Desktop\\commencement_project"
)

data-steve/holstr documentation built on May 14, 2019, 6:17 p.m.