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. Directory path(s).

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 Jan. 28, 2024, 2:59 a.m.