Searches upward from path for an RStudio project file (a .Rproj whose
first line is Version: ) or a git repository (a .git directory, or a
.git file pointing elsewhere, as used by worktrees and submodules),
falling back on path itself when neither is found.
Usage
findProjectPath(path = getwd())
Value
An absolute path to the project root, or path if no project marker
is found above it.
Arguments
path
The directory to search upward from. Defaults to getwd().
Details
This uses rprojroot when it is available. rprojroot is in
Suggests, so when it is not installed this simply returns path, which is
the same answer the fallback gives.