EVOLUTION-MANAGER
Edit File: find_root.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Find the root of a directory hierarchy</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for find_root {rprojroot}"><tr><td>find_root {rprojroot}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Find the root of a directory hierarchy</h2> <h3>Description</h3> <p>A <em>root</em> is defined as a directory that contains a regular file whose name matches a given pattern and which optionally contains a given text. The search for a root starts at a given directory (the working directory by default), and proceeds up the directory hierarchy. </p> <p><code>get_root_desc()</code> returns the description of the criterion for a root path. This is especially useful for composite root criteria created with <code><a href="root_criterion.html">|.root_criterion()</a></code>. </p> <h3>Usage</h3> <pre> find_root(criterion, path = ".") get_root_desc(criterion, path) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>criterion</code></td> <td> <p>A criterion, will be coerced using <code><a href="root_criterion.html">as.root_criterion()</a></code></p> </td></tr> <tr valign="top"><td><code>path</code></td> <td> <p>The start directory</p> </td></tr> </table> <h3>Details</h3> <p>Starting from the working directory, the <code>find_root()</code> function searches for the root. If a root is found, the <code>...</code> arguments are used to construct a path; thus, if no extra arguments are given, the root is returned. If no root is found, an error is thrown. </p> <h3>Value</h3> <p>The normalized path of the root as specified by the search criterion. Throws an error if no root is found </p> <h3>See Also</h3> <p><code><a href="../../utils/html/glob2rx.html">utils::glob2rx()</a></code> <code><a href="../../base/html/file.path.html">file.path()</a></code> </p> <h3>Examples</h3> <pre> ## Not run: find_root(glob2rx("DESCRIPTION"), "^Package: ") ## End(Not run) </pre> <hr /><div style="text-align: center;">[Package <em>rprojroot</em> version 1.3-2 <a href="00Index.html">Index</a>]</div> </body></html>