parentDirectory: Parent directory recursion

View source: R/parentDirectory.R

parentDirectoryR Documentation

Parent directory recursion

Description

Parent directory recursion

Usage

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

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 Nov. 29, 2022, 7:39 a.m.