find_root_file

0th

Percentile

File paths relative to the root of a directory hierarchy

Append an arbitrary number of path components to the root using base::file.path().

Usage
find_root_file(..., criterion, path = ".")

find_rstudio_root_file(..., path = ".")

find_package_root_file(..., path = ".")

find_remake_root_file(..., path = ".")

find_testthat_root_file(..., path = ".")

Arguments
...

Further path components passed to file.path()

criterion

A criterion, will be coerced using as.root_criterion()

path

The start directory

Details

The find_root_file() function is a simple wrapper around find_root() that appends an arbitrary number of path components to the root using base::file.path().

Value

The normalized path of the root as specified by the search criteria, with the additional path components appended. Throws an error if no root is found

See Also

find_root() utils::glob2rx() base::file.path()

Aliases
  • find_root_file
  • find_rstudio_root_file
  • find_package_root_file
  • find_remake_root_file
  • find_testthat_root_file
Examples
# NOT RUN {
find_package_root_file("tests", "testthat.R")
has_file("DESCRIPTION", "^Package: ")$find_file
has_file("DESCRIPTION", "^Package: ")$make_fix_file(".")
# }
# NOT RUN {
# }
Documentation reproduced from package rprojroot, version 1.3-2, License: GPL-3

Community examples

Looks like there are no examples yet.