Skip to contents

Unexported helper to find the root of the R package. Returns an error if the path specified is not an R package.

Usage

pkg_root(pkg_path = ".", ...)

Arguments

pkg_path

Path to the package directory. Default is "." for the current working directory, which assumes developer is working in R package root. However, this can be set to another path as needed.

...

Arguments passed to rprojroot::find_package_root_file.

Value

A file path of the package root. If no package is found at the root then the function will stop with an error message.