parentDirectory: Parent directory recursion

Description Usage Arguments Details Value Note Examples

View source: R/parentDirectory.R

Description

Parent directory recursion

Usage

1
2
3
parentDirectory(path, n = 1L)

parentDir(path, n = 1L)

Arguments

path

character. Local file and/or directory paths. Also supports URLs.

n

logical(1). Number of levels to recursive. Defaults to the immediate parent, similar to dirname.

Details

Function always resolves directory path internally, using realpath.

Value

character.

Note

Updated 2021-09-03.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
dir <- getwd()
url <- pasteURL(
    "r.acidgenomics.com",
    "packages",
    "acidbase",
    "reference",
    "parentDirectory.html",
    protocol = "https"
)
path <- c(dir, url)
parentDir(path = path)

acidgenomics/AcidBase documentation built on Sept. 10, 2021, 1:27 a.m.