Parent directory recursion
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 todirname
.
Examples
dir <- getwd()
url <- pasteUrl(
"r.acidgenomics.com",
"packages",
"acidbase",
"reference",
"parentDirectory.html",
protocol = "https"
)
path <- c(dir, url)
parentDir(path = path)
#> [1] "/Users/mike/git/monorepo/r-packages/AcidBase/docs"
#> [2] "https://r.acidgenomics.com/packages/acidbase/reference"