New Upstream Snapshot - r-cran-rprojroot

Ready changes

Summary

Merged new upstream version: 2.0.3.9002 (was: 2.0.3).

Resulting package

Built on 2023-01-20T01:41 (took 8m56s)

The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:

apt install -t fresh-snapshots r-cran-rprojroot

Lintian Result

Diff

diff --git a/DESCRIPTION b/DESCRIPTION
index 6e82127..73f8caa 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,6 +1,6 @@
 Package: rprojroot
 Title: Finding Files in Project Subdirectories
-Version: 2.0.3
+Version: 2.0.3.9002
 Authors@R: 
     person(given = "Kirill",
            family = "M\u00fcller",
@@ -19,10 +19,9 @@ Suggests: covr, knitr, lifecycle, mockr, rmarkdown, testthat (>=
 VignetteBuilder: knitr
 Config/testthat/edition: 3
 Encoding: UTF-8
-RoxygenNote: 7.1.2
+Roxygen: list(markdown = TRUE, load = "source")
+RoxygenNote: 7.2.3
 NeedsCompilation: no
-Packaged: 2022-04-02 16:14:00 UTC; kirill
+Packaged: 2023-01-20 01:37:07 UTC; root
 Author: Kirill Müller [aut, cre] (<https://orcid.org/0000-0002-1416-3412>)
 Maintainer: Kirill Müller <krlmlr+r@mailbox.org>
-Repository: CRAN
-Date/Publication: 2022-04-02 16:40:02 UTC
diff --git a/MD5 b/MD5
deleted file mode 100644
index f4d0bba..0000000
--- a/MD5
+++ /dev/null
@@ -1,64 +0,0 @@
-a3a365cc9c8d3d61972c76fde3820498 *DESCRIPTION
-1a988b93209b9f325be60b4fc5c842a8 *LICENSE
-96545496449c3ccbfd0049ec5d655486 *NAMESPACE
-8e3f463ed6301fc56af121ae82b550a1 *NEWS.md
-fc5d6eebf8e6e87affaf596023359ddc *R/absolute.R
-4c8fa3abb9748090275a467784cd9a61 *R/criterion.R
-13136f1a572062f4a708ecd1fe172654 *R/deprecated.R
-68d44a7082260a2a7af0141dfbd03147 *R/file.R
-ad1cf8f1c772a98b195cdd0dfd881653 *R/path.R
-c08079e26db1cb9255cd0df137f41228 *R/root.R
-624e9a6ec6b06a74b0e7267a9d68f609 *R/rprojroot-package.R
-4de9a9bbf48372e1505dd1550bee0418 *R/shortcut.R
-37d1f0a7b1f5a243713a33edeca4e95d *R/thisfile.R
-b3d903bcf82196ec51defeb5a0a56507 *R/utils.R
-9cfccc7b09193cf33a1d2ec3cc324868 *README.md
-bc7173330a7f4585558147895d5efe3b *build/vignette.rds
-0c660195baf64ac65aa74e64cbfd726b *inst/WORDLIST
-d812b2efd90edaf7b4788070e252488a *inst/doc/rprojroot.R
-66e0c47a97adfb513cdecea04389533d *inst/doc/rprojroot.Rmd
-2578b1c8790047c4049e259b39e12c4a *inst/doc/rprojroot.html
-3e9e64fb1ca92b5e463ed55c880a0a27 *man/criteria.Rd
-a27e4391bab0a071072998710c235039 *man/deprecated.Rd
-cb1e46f469cfbbbde29c8b5113e1d789 *man/figures/lifecycle-archived.svg
-c0d2e5a54f1fa4ff02bf9533079dd1f7 *man/figures/lifecycle-defunct.svg
-a1b8c987c676c16af790f563f96cbb1f *man/figures/lifecycle-deprecated.svg
-c3978703d8f40f2679795335715e98f4 *man/figures/lifecycle-experimental.svg
-952b59dc07b171b97d5d982924244f61 *man/figures/lifecycle-maturing.svg
-27b879bf3677ea76e3991d56ab324081 *man/figures/lifecycle-questioning.svg
-6902bbfaf963fbc4ed98b86bda80caa2 *man/figures/lifecycle-soft-deprecated.svg
-53b3f893324260b737b3c46ed2a0e643 *man/figures/lifecycle-stable.svg
-1c1fe7a759b86dc6dbcbe7797ab8246c *man/figures/lifecycle-superseded.svg
-ef0e63b7a15c468ccc5c065129c4b847 *man/find_root.Rd
-606641411841f90fcfd3d516514934e6 *man/find_root_file.Rd
-3faaf464273c1a73a5f2e4d9a7cbcea1 *man/root_criterion.Rd
-fed13511494fb6b80cf01e75cd50170d *man/rprojroot-package.Rd
-a170d87ee82034f16b259be704b18b26 *man/thisfile.Rd
-1d802d92f687ffbb11ee26ae68396d94 *tests/testthat.R
-c78de74687cdb8e6f87dd867a07a1aa0 *tests/testthat/_snaps/root.md
-a9e236c40b363793546be3d943716cf5 *tests/testthat/_snaps/testthat.md
-f0cfca3e229adfcf416e2caa79d440f4 *tests/testthat/hierarchy/DESCRIPTION
-d41d8cd98f00b204e9800998ecf8427e *tests/testthat/hierarchy/a/b/a
-b16de7308a1f8d6f4f98b1a558ea957d *tests/testthat/hierarchy/a/b/b
-d41d8cd98f00b204e9800998ecf8427e *tests/testthat/hierarchy/a/b/c/d
-d41d8cd98f00b204e9800998ecf8427e *tests/testthat/hierarchy/a/b/d/e
-d41d8cd98f00b204e9800998ecf8427e *tests/testthat/hierarchy/a/remake.yml
-55e116ea754236d78e4e6342adbe3661 *tests/testthat/hierarchy/b
-d41d8cd98f00b204e9800998ecf8427e *tests/testthat/hierarchy/c
-3936ed002c1dd1fa5dc7a13d99d5df86 *tests/testthat/hierarchy/hierarchy.Rproj
-d41d8cd98f00b204e9800998ecf8427e *tests/testthat/package/DESCRIPTION
-68b329da9893e34099c7d8ad5cb9c940 *tests/testthat/package/tests/testthat.R
-68b329da9893e34099c7d8ad5cb9c940 *tests/testthat/package/tests/testthat/test-something.R
-4450e46cec462306555081ab955c7ae8 *tests/testthat/scripts/thisfile-cat.R
-1842225c060e51ad4fd7a44cf6dc2c68 *tests/testthat/scripts/thisfile.R
-b4eea69f30e5e903f792b50357b04e40 *tests/testthat/scripts/thisfile.Rmd
-d41d8cd98f00b204e9800998ecf8427e *tests/testthat/startup.Rs
-a1354ce540e9280483a5e40d0c80a845 *tests/testthat/test-absolute.R
-32495223ad8e12abe422d088a250af2f *tests/testthat/test-criterion.R
-efee88fffb51e72ef0ddb6e7c5c837e9 *tests/testthat/test-file.R
-fabb5ac8fc1e28588f08f1753bc4733a *tests/testthat/test-path.R
-60d2e643d188e1cf5c220f5b6a71831f *tests/testthat/test-root.R
-a4ed88f8a0edd04bdb2d2ab2e30fb9f2 *tests/testthat/test-testthat.R
-d8879d25ee21b0f84992020d95500aaf *tests/testthat/vcs/git.zip
-28e9555632b66c264d026cd065dda0db *tests/testthat/vcs/svn.zip
-66e0c47a97adfb513cdecea04389533d *vignettes/rprojroot.Rmd
diff --git a/NEWS.md b/NEWS.md
index cf937f1..594a830 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,5 +1,25 @@
 <!-- NEWS.md is maintained by https://cynkra.github.io/fledge, do not edit -->
 
+# rprojroot 2.0.3.9002 (2022-12-30)
+
+- Internal changes only.
+
+
+# rprojroot 2.0.3.9001 (2022-12-24)
+
+- Harmonize yaml formatting.
+
+- Revert changes to matrix section.
+
+- Merged cran-2.0.3 into main.
+
+
+
+# rprojroot 2.0.3.9000 (2022-03-25)
+
+- Same as previous version.
+
+
 # rprojroot 2.0.3 (2022-03-25)
 
 - Add `is_pkgdown_project` root criterion looking for a `_pkgdown.yml`, `_pkgdown.yaml`, `pkgdown/_pkgdown.yml` and/or `inst/_pkgdown.yml` file (#79, @salim-b).
diff --git a/build/vignette.rds b/build/vignette.rds
index 10750f3..bfbb41f 100644
Binary files a/build/vignette.rds and b/build/vignette.rds differ
diff --git a/debian/changelog b/debian/changelog
index 8a69d0a..d0f4056 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+r-cran-rprojroot (2.0.3.9002-1) UNRELEASED; urgency=low
+
+  * New upstream release.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Fri, 20 Jan 2023 01:37:38 -0000
+
 r-cran-rprojroot (2.0.3-1) unstable; urgency=medium
 
   * Team upload.
diff --git a/inst/doc/rprojroot.html b/inst/doc/rprojroot.html
index f6695b7..c10672f 100644
--- a/inst/doc/rprojroot.html
+++ b/inst/doc/rprojroot.html
@@ -12,11 +12,23 @@
 
 <meta name="author" content="Kirill Müller" />
 
-<meta name="date" content="2022-04-02" />
+<meta name="date" content="2023-01-20" />
 
 <title>Finding files in project subdirectories</title>
 
-<script src="data:application/javascript;base64,Ly8gUGFuZG9jIDIuOSBhZGRzIGF0dHJpYnV0ZXMgb24gYm90aCBoZWFkZXIgYW5kIGRpdi4gV2UgcmVtb3ZlIHRoZSBmb3JtZXIgKHRvCi8vIGJlIGNvbXBhdGlibGUgd2l0aCB0aGUgYmVoYXZpb3Igb2YgUGFuZG9jIDwgMi44KS4KZG9jdW1lbnQuYWRkRXZlbnRMaXN0ZW5lcignRE9NQ29udGVudExvYWRlZCcsIGZ1bmN0aW9uKGUpIHsKICB2YXIgaHMgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCJkaXYuc2VjdGlvbltjbGFzcyo9J2xldmVsJ10gPiA6Zmlyc3QtY2hpbGQiKTsKICB2YXIgaSwgaCwgYTsKICBmb3IgKGkgPSAwOyBpIDwgaHMubGVuZ3RoOyBpKyspIHsKICAgIGggPSBoc1tpXTsKICAgIGlmICghL15oWzEtNl0kL2kudGVzdChoLnRhZ05hbWUpKSBjb250aW51ZTsgIC8vIGl0IHNob3VsZCBiZSBhIGhlYWRlciBoMS1oNgogICAgYSA9IGguYXR0cmlidXRlczsKICAgIHdoaWxlIChhLmxlbmd0aCA+IDApIGgucmVtb3ZlQXR0cmlidXRlKGFbMF0ubmFtZSk7CiAgfQp9KTsK"></script>
+<script>// Pandoc 2.9 adds attributes on both header and div. We remove the former (to
+// be compatible with the behavior of Pandoc < 2.8).
+document.addEventListener('DOMContentLoaded', function(e) {
+  var hs = document.querySelectorAll("div.section[class*='level'] > :first-child");
+  var i, h, a;
+  for (i = 0; i < hs.length; i++) {
+    h = hs[i];
+    if (!/^h[1-6]$/i.test(h.tagName)) continue;  // it should be a header h1-h6
+    a = h.attributes;
+    while (a.length > 0) h.removeAttribute(a[0].name);
+  }
+});
+</script>
 
 <style type="text/css">
   code{white-space: pre-wrap;}
@@ -28,6 +40,7 @@
     </style>
 
 
+
 <style type="text/css">
   code {
     white-space: pre;
@@ -75,7 +88,7 @@ code span.al { color: #ff0000; font-weight: bold; } /* Alert */
 code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
 code span.at { color: #7d9029; } /* Attribute */
 code span.bn { color: #40a070; } /* BaseN */
-code span.bu { } /* BuiltIn */
+code span.bu { color: #008000; } /* BuiltIn */
 code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
 code span.ch { color: #4070a0; } /* Char */
 code span.cn { color: #880000; } /* Constant */
@@ -88,7 +101,7 @@ code span.er { color: #ff0000; font-weight: bold; } /* Error */
 code span.ex { } /* Extension */
 code span.fl { color: #40a070; } /* Float */
 code span.fu { color: #06287e; } /* Function */
-code span.im { } /* Import */
+code span.im { color: #008000; font-weight: bold; } /* Import */
 code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
 code span.kw { color: #007020; font-weight: bold; } /* Keyword */
 code span.op { color: #666666; } /* Operator */
@@ -109,13 +122,20 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
   for (var i = 0; i < sheets.length; i++) {
     if (sheets[i].ownerNode.dataset["origin"] !== "pandoc") continue;
     try { var rules = sheets[i].cssRules; } catch (e) { continue; }
-    for (var j = 0; j < rules.length; j++) {
+    var j = 0;
+    while (j < rules.length) {
       var rule = rules[j];
       // check if there is a div.sourceCode rule
-      if (rule.type !== rule.STYLE_RULE || rule.selectorText !== "div.sourceCode") continue;
+      if (rule.type !== rule.STYLE_RULE || rule.selectorText !== "div.sourceCode") {
+        j++;
+        continue;
+      }
       var style = rule.style.cssText;
       // check if color or background-color is set
-      if (rule.style.color === '' && rule.style.backgroundColor === '') continue;
+      if (rule.style.color === '' && rule.style.backgroundColor === '') {
+        j++;
+        continue;
+      }
       // replace div.sourceCode by a pre.sourceCode rule
       sheets[i].deleteRule(j);
       sheets[i].insertRule('pre.sourceCode{' + style + '}', j);
@@ -127,7 +147,187 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
 
 
 
-<link rel="stylesheet" href="data:text/css,body%20%7B%0Abackground%2Dcolor%3A%20%23fff%3B%0Amargin%3A%201em%20auto%3B%0Amax%2Dwidth%3A%20700px%3B%0Aoverflow%3A%20visible%3B%0Apadding%2Dleft%3A%202em%3B%0Apadding%2Dright%3A%202em%3B%0Afont%2Dfamily%3A%20%22Open%20Sans%22%2C%20%22Helvetica%20Neue%22%2C%20Helvetica%2C%20Arial%2C%20sans%2Dserif%3B%0Afont%2Dsize%3A%2014px%3B%0Aline%2Dheight%3A%201%2E35%3B%0A%7D%0A%23TOC%20%7B%0Aclear%3A%20both%3B%0Amargin%3A%200%200%2010px%2010px%3B%0Apadding%3A%204px%3B%0Awidth%3A%20400px%3B%0Aborder%3A%201px%20solid%20%23CCCCCC%3B%0Aborder%2Dradius%3A%205px%3B%0Abackground%2Dcolor%3A%20%23f6f6f6%3B%0Afont%2Dsize%3A%2013px%3B%0Aline%2Dheight%3A%201%2E3%3B%0A%7D%0A%23TOC%20%2Etoctitle%20%7B%0Afont%2Dweight%3A%20bold%3B%0Afont%2Dsize%3A%2015px%3B%0Amargin%2Dleft%3A%205px%3B%0A%7D%0A%23TOC%20ul%20%7B%0Apadding%2Dleft%3A%2040px%3B%0Amargin%2Dleft%3A%20%2D1%2E5em%3B%0Amargin%2Dtop%3A%205px%3B%0Amargin%2Dbottom%3A%205px%3B%0A%7D%0A%23TOC%20ul%20ul%20%7B%0Amargin%2Dleft%3A%20%2D2em%3B%0A%7D%0A%23TOC%20li%20%7B%0Aline%2Dheight%3A%2016px%3B%0A%7D%0Atable%20%7B%0Amargin%3A%201em%20auto%3B%0Aborder%2Dwidth%3A%201px%3B%0Aborder%2Dcolor%3A%20%23DDDDDD%3B%0Aborder%2Dstyle%3A%20outset%3B%0Aborder%2Dcollapse%3A%20collapse%3B%0A%7D%0Atable%20th%20%7B%0Aborder%2Dwidth%3A%202px%3B%0Apadding%3A%205px%3B%0Aborder%2Dstyle%3A%20inset%3B%0A%7D%0Atable%20td%20%7B%0Aborder%2Dwidth%3A%201px%3B%0Aborder%2Dstyle%3A%20inset%3B%0Aline%2Dheight%3A%2018px%3B%0Apadding%3A%205px%205px%3B%0A%7D%0Atable%2C%20table%20th%2C%20table%20td%20%7B%0Aborder%2Dleft%2Dstyle%3A%20none%3B%0Aborder%2Dright%2Dstyle%3A%20none%3B%0A%7D%0Atable%20thead%2C%20table%20tr%2Eeven%20%7B%0Abackground%2Dcolor%3A%20%23f7f7f7%3B%0A%7D%0Ap%20%7B%0Amargin%3A%200%2E5em%200%3B%0A%7D%0Ablockquote%20%7B%0Abackground%2Dcolor%3A%20%23f6f6f6%3B%0Apadding%3A%200%2E25em%200%2E75em%3B%0A%7D%0Ahr%20%7B%0Aborder%2Dstyle%3A%20solid%3B%0Aborder%3A%20none%3B%0Aborder%2Dtop%3A%201px%20solid%20%23777%3B%0Amargin%3A%2028px%200%3B%0A%7D%0Adl%20%7B%0Amargin%2Dleft%3A%200%3B%0A%7D%0Adl%20dd%20%7B%0Amargin%2Dbottom%3A%2013px%3B%0Amargin%2Dleft%3A%2013px%3B%0A%7D%0Adl%20dt%20%7B%0Afont%2Dweight%3A%20bold%3B%0A%7D%0Aul%20%7B%0Amargin%2Dtop%3A%200%3B%0A%7D%0Aul%20li%20%7B%0Alist%2Dstyle%3A%20circle%20outside%3B%0A%7D%0Aul%20ul%20%7B%0Amargin%2Dbottom%3A%200%3B%0A%7D%0Apre%2C%20code%20%7B%0Abackground%2Dcolor%3A%20%23f7f7f7%3B%0Aborder%2Dradius%3A%203px%3B%0Acolor%3A%20%23333%3B%0Awhite%2Dspace%3A%20pre%2Dwrap%3B%20%0A%7D%0Apre%20%7B%0Aborder%2Dradius%3A%203px%3B%0Amargin%3A%205px%200px%2010px%200px%3B%0Apadding%3A%2010px%3B%0A%7D%0Apre%3Anot%28%5Bclass%5D%29%20%7B%0Abackground%2Dcolor%3A%20%23f7f7f7%3B%0A%7D%0Acode%20%7B%0Afont%2Dfamily%3A%20Consolas%2C%20Monaco%2C%20%27Courier%20New%27%2C%20monospace%3B%0Afont%2Dsize%3A%2085%25%3B%0A%7D%0Ap%20%3E%20code%2C%20li%20%3E%20code%20%7B%0Apadding%3A%202px%200px%3B%0A%7D%0Adiv%2Efigure%20%7B%0Atext%2Dalign%3A%20center%3B%0A%7D%0Aimg%20%7B%0Abackground%2Dcolor%3A%20%23FFFFFF%3B%0Apadding%3A%202px%3B%0Aborder%3A%201px%20solid%20%23DDDDDD%3B%0Aborder%2Dradius%3A%203px%3B%0Aborder%3A%201px%20solid%20%23CCCCCC%3B%0Amargin%3A%200%205px%3B%0A%7D%0Ah1%20%7B%0Amargin%2Dtop%3A%200%3B%0Afont%2Dsize%3A%2035px%3B%0Aline%2Dheight%3A%2040px%3B%0A%7D%0Ah2%20%7B%0Aborder%2Dbottom%3A%204px%20solid%20%23f7f7f7%3B%0Apadding%2Dtop%3A%2010px%3B%0Apadding%2Dbottom%3A%202px%3B%0Afont%2Dsize%3A%20145%25%3B%0A%7D%0Ah3%20%7B%0Aborder%2Dbottom%3A%202px%20solid%20%23f7f7f7%3B%0Apadding%2Dtop%3A%2010px%3B%0Afont%2Dsize%3A%20120%25%3B%0A%7D%0Ah4%20%7B%0Aborder%2Dbottom%3A%201px%20solid%20%23f7f7f7%3B%0Amargin%2Dleft%3A%208px%3B%0Afont%2Dsize%3A%20105%25%3B%0A%7D%0Ah5%2C%20h6%20%7B%0Aborder%2Dbottom%3A%201px%20solid%20%23ccc%3B%0Afont%2Dsize%3A%20105%25%3B%0A%7D%0Aa%20%7B%0Acolor%3A%20%230033dd%3B%0Atext%2Ddecoration%3A%20none%3B%0A%7D%0Aa%3Ahover%20%7B%0Acolor%3A%20%236666ff%3B%20%7D%0Aa%3Avisited%20%7B%0Acolor%3A%20%23800080%3B%20%7D%0Aa%3Avisited%3Ahover%20%7B%0Acolor%3A%20%23BB00BB%3B%20%7D%0Aa%5Bhref%5E%3D%22http%3A%22%5D%20%7B%0Atext%2Ddecoration%3A%20underline%3B%20%7D%0Aa%5Bhref%5E%3D%22https%3A%22%5D%20%7B%0Atext%2Ddecoration%3A%20underline%3B%20%7D%0A%0Acode%20%3E%20span%2Ekw%20%7B%20color%3A%20%23555%3B%20font%2Dweight%3A%20bold%3B%20%7D%20%0Acode%20%3E%20span%2Edt%20%7B%20color%3A%20%23902000%3B%20%7D%20%0Acode%20%3E%20span%2Edv%20%7B%20color%3A%20%2340a070%3B%20%7D%20%0Acode%20%3E%20span%2Ebn%20%7B%20color%3A%20%23d14%3B%20%7D%20%0Acode%20%3E%20span%2Efl%20%7B%20color%3A%20%23d14%3B%20%7D%20%0Acode%20%3E%20span%2Ech%20%7B%20color%3A%20%23d14%3B%20%7D%20%0Acode%20%3E%20span%2Est%20%7B%20color%3A%20%23d14%3B%20%7D%20%0Acode%20%3E%20span%2Eco%20%7B%20color%3A%20%23888888%3B%20font%2Dstyle%3A%20italic%3B%20%7D%20%0Acode%20%3E%20span%2Eot%20%7B%20color%3A%20%23007020%3B%20%7D%20%0Acode%20%3E%20span%2Eal%20%7B%20color%3A%20%23ff0000%3B%20font%2Dweight%3A%20bold%3B%20%7D%20%0Acode%20%3E%20span%2Efu%20%7B%20color%3A%20%23900%3B%20font%2Dweight%3A%20bold%3B%20%7D%20%0Acode%20%3E%20span%2Eer%20%7B%20color%3A%20%23a61717%3B%20background%2Dcolor%3A%20%23e3d2d2%3B%20%7D%20%0A" type="text/css" />
+<style type="text/css">body {
+background-color: #fff;
+margin: 1em auto;
+max-width: 700px;
+overflow: visible;
+padding-left: 2em;
+padding-right: 2em;
+font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
+font-size: 14px;
+line-height: 1.35;
+}
+#TOC {
+clear: both;
+margin: 0 0 10px 10px;
+padding: 4px;
+width: 400px;
+border: 1px solid #CCCCCC;
+border-radius: 5px;
+background-color: #f6f6f6;
+font-size: 13px;
+line-height: 1.3;
+}
+#TOC .toctitle {
+font-weight: bold;
+font-size: 15px;
+margin-left: 5px;
+}
+#TOC ul {
+padding-left: 40px;
+margin-left: -1.5em;
+margin-top: 5px;
+margin-bottom: 5px;
+}
+#TOC ul ul {
+margin-left: -2em;
+}
+#TOC li {
+line-height: 16px;
+}
+table {
+margin: 1em auto;
+border-width: 1px;
+border-color: #DDDDDD;
+border-style: outset;
+border-collapse: collapse;
+}
+table th {
+border-width: 2px;
+padding: 5px;
+border-style: inset;
+}
+table td {
+border-width: 1px;
+border-style: inset;
+line-height: 18px;
+padding: 5px 5px;
+}
+table, table th, table td {
+border-left-style: none;
+border-right-style: none;
+}
+table thead, table tr.even {
+background-color: #f7f7f7;
+}
+p {
+margin: 0.5em 0;
+}
+blockquote {
+background-color: #f6f6f6;
+padding: 0.25em 0.75em;
+}
+hr {
+border-style: solid;
+border: none;
+border-top: 1px solid #777;
+margin: 28px 0;
+}
+dl {
+margin-left: 0;
+}
+dl dd {
+margin-bottom: 13px;
+margin-left: 13px;
+}
+dl dt {
+font-weight: bold;
+}
+ul {
+margin-top: 0;
+}
+ul li {
+list-style: circle outside;
+}
+ul ul {
+margin-bottom: 0;
+}
+pre, code {
+background-color: #f7f7f7;
+border-radius: 3px;
+color: #333;
+white-space: pre-wrap; 
+}
+pre {
+border-radius: 3px;
+margin: 5px 0px 10px 0px;
+padding: 10px;
+}
+pre:not([class]) {
+background-color: #f7f7f7;
+}
+code {
+font-family: Consolas, Monaco, 'Courier New', monospace;
+font-size: 85%;
+}
+p > code, li > code {
+padding: 2px 0px;
+}
+div.figure {
+text-align: center;
+}
+img {
+background-color: #FFFFFF;
+padding: 2px;
+border: 1px solid #DDDDDD;
+border-radius: 3px;
+border: 1px solid #CCCCCC;
+margin: 0 5px;
+}
+h1 {
+margin-top: 0;
+font-size: 35px;
+line-height: 40px;
+}
+h2 {
+border-bottom: 4px solid #f7f7f7;
+padding-top: 10px;
+padding-bottom: 2px;
+font-size: 145%;
+}
+h3 {
+border-bottom: 2px solid #f7f7f7;
+padding-top: 10px;
+font-size: 120%;
+}
+h4 {
+border-bottom: 1px solid #f7f7f7;
+margin-left: 8px;
+font-size: 105%;
+}
+h5, h6 {
+border-bottom: 1px solid #ccc;
+font-size: 105%;
+}
+a {
+color: #0033dd;
+text-decoration: none;
+}
+a:hover {
+color: #6666ff; }
+a:visited {
+color: #800080; }
+a:visited:hover {
+color: #BB00BB; }
+a[href^="http:"] {
+text-decoration: underline; }
+a[href^="https:"] {
+text-decoration: underline; }
+
+code > span.kw { color: #555; font-weight: bold; } 
+code > span.dt { color: #902000; } 
+code > span.dv { color: #40a070; } 
+code > span.bn { color: #d14; } 
+code > span.fl { color: #d14; } 
+code > span.ch { color: #d14; } 
+code > span.st { color: #d14; } 
+code > span.co { color: #888888; font-style: italic; } 
+code > span.ot { color: #007020; } 
+code > span.al { color: #ff0000; font-weight: bold; } 
+code > span.fu { color: #900; font-weight: bold; } 
+code > span.er { color: #a61717; background-color: #e3d2d2; } 
+</style>
 
 
 
@@ -139,14 +339,19 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
 
 
 
-<h1 class="title toc-ignore">Finding files in project subdirectories</h1>
+<h1 class="title toc-ignore">Finding files in project
+subdirectories</h1>
 <h4 class="author">Kirill Müller</h4>
-<h4 class="date">2022-04-02</h4>
+<h4 class="date">2023-01-20</h4>
 
 
 
-<p>The <em>rprojroot</em> package solves a seemingly trivial but annoying problem that occurs sooner or later in any largish project: How to find files in subdirectories? Ideally, file paths are relative to the <em>project root</em>.</p>
-<p>Unfortunately, we cannot always be sure about the current working directory: For instance, in RStudio it’s sometimes:</p>
+<p>The <em>rprojroot</em> package solves a seemingly trivial but
+annoying problem that occurs sooner or later in any largish project: How
+to find files in subdirectories? Ideally, file paths are relative to the
+<em>project root</em>.</p>
+<p>Unfortunately, we cannot always be sure about the current working
+directory: For instance, in RStudio it’s sometimes:</p>
 <ul>
 <li>the project root (when running R scripts),</li>
 <li>a subdirectory (when building vignettes),</li>
@@ -155,7 +360,8 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
 <div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">basename</span>(<span class="fu">getwd</span>())</span></code></pre></div>
 <pre><code>## [1] &quot;vignettes&quot;</code></pre>
 <p>In some cases, it’s even outside the project root.</p>
-<p>This vignette starts with a very brief summary that helps you get started, followed by a longer description of the features.</p>
+<p>This vignette starts with a very brief summary that helps you get
+started, followed by a longer description of the features.</p>
 <div id="tldr" class="section level2">
 <h2>TL;DR</h2>
 <p>What is your project: An R package?</p>
@@ -169,46 +375,75 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
 <pre><code>## Root criterion: contains a file &quot;.git/index&quot;</code></pre>
 <p>For now, we assume it’s an R package:</p>
 <div class="sourceCode" id="cb9"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a>root <span class="ot">&lt;-</span> rprojroot<span class="sc">::</span>is_r_package</span></code></pre></div>
-<p>The <code>root</code> object contains a function that helps locating files below the root of your package, regardless of your current working directory. If you are sure that your working directory is somewhere below your project’s root, use the <code>root$find_file()</code> function. In this example here, we’re starting in the <code>vignettes</code> subdirectory and find the original <code>DESCRIPTION</code> file:</p>
+<p>The <code>root</code> object contains a function that helps locating
+files below the root of your package, regardless of your current working
+directory. If you are sure that your working directory is somewhere
+below your project’s root, use the <code>root$find_file()</code>
+function. In this example here, we’re starting in the
+<code>vignettes</code> subdirectory and find the original
+<code>DESCRIPTION</code> file:</p>
 <div class="sourceCode" id="cb10"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a><span class="fu">basename</span>(<span class="fu">getwd</span>())</span></code></pre></div>
 <pre><code>## [1] &quot;vignettes&quot;</code></pre>
 <div class="sourceCode" id="cb12"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a><span class="fu">readLines</span>(root<span class="sc">$</span><span class="fu">find_file</span>(<span class="st">&quot;DESCRIPTION&quot;</span>), <span class="dv">3</span>)</span></code></pre></div>
 <pre><code>## [1] &quot;Package: rprojroot&quot;                            
 ## [2] &quot;Title: Finding Files in Project Subdirectories&quot;
-## [3] &quot;Version: 2.0.3&quot;</code></pre>
-<p>There is one exception: if the first component passed to <code>find_file()</code> is already an absolute path. This allows safely applying this function to paths that may be absolute or relative:</p>
+## [3] &quot;Version: 2.0.3.9002&quot;</code></pre>
+<p>There is one exception: if the first component passed to
+<code>find_file()</code> is already an absolute path. This allows safely
+applying this function to paths that may be absolute or relative:</p>
 <div class="sourceCode" id="cb14"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true" tabindex="-1"></a>path <span class="ot">&lt;-</span> root<span class="sc">$</span><span class="fu">find_file</span>()</span>
 <span id="cb14-2"><a href="#cb14-2" aria-hidden="true" tabindex="-1"></a><span class="fu">readLines</span>(root<span class="sc">$</span><span class="fu">find_file</span>(path, <span class="st">&quot;DESCRIPTION&quot;</span>), <span class="dv">3</span>)</span></code></pre></div>
 <pre><code>## [1] &quot;Package: rprojroot&quot;                            
 ## [2] &quot;Title: Finding Files in Project Subdirectories&quot;
-## [3] &quot;Version: 2.0.3&quot;</code></pre>
-<p>You can also construct an accessor to your root using the <code>root$make_fix_file()</code> function:</p>
+## [3] &quot;Version: 2.0.3.9002&quot;</code></pre>
+<p>You can also construct an accessor to your root using the
+<code>root$make_fix_file()</code> function:</p>
 <div class="sourceCode" id="cb16"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb16-1"><a href="#cb16-1" aria-hidden="true" tabindex="-1"></a>root_file <span class="ot">&lt;-</span> root<span class="sc">$</span><span class="fu">make_fix_file</span>()</span></code></pre></div>
-<p>Note that <code>root_file()</code> is a <em>function</em> that works just like <code>$find_file()</code> but will find the files even if the current working directory is outside your project:</p>
+<p>Note that <code>root_file()</code> is a <em>function</em> that works
+just like <code>$find_file()</code> but will find the files even if the
+current working directory is outside your project:</p>
 <div class="sourceCode" id="cb17"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb17-1"><a href="#cb17-1" aria-hidden="true" tabindex="-1"></a>withr<span class="sc">::</span><span class="fu">with_dir</span>(</span>
 <span id="cb17-2"><a href="#cb17-2" aria-hidden="true" tabindex="-1"></a>  <span class="st">&quot;../..&quot;</span>,</span>
 <span id="cb17-3"><a href="#cb17-3" aria-hidden="true" tabindex="-1"></a>  <span class="fu">readLines</span>(<span class="fu">root_file</span>(<span class="st">&quot;DESCRIPTION&quot;</span>), <span class="dv">3</span>)</span>
 <span id="cb17-4"><a href="#cb17-4" aria-hidden="true" tabindex="-1"></a>)</span></code></pre></div>
 <pre><code>## [1] &quot;Package: rprojroot&quot;                            
 ## [2] &quot;Title: Finding Files in Project Subdirectories&quot;
-## [3] &quot;Version: 2.0.3&quot;</code></pre>
-<p>If you know the absolute path of some directory below your project, but cannot be sure of your current working directory, pass that absolute path to <code>root$make_fix_file()</code>:</p>
+## [3] &quot;Version: 2.0.3.9002&quot;</code></pre>
+<p>If you know the absolute path of some directory below your project,
+but cannot be sure of your current working directory, pass that absolute
+path to <code>root$make_fix_file()</code>:</p>
 <div class="sourceCode" id="cb19"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb19-1"><a href="#cb19-1" aria-hidden="true" tabindex="-1"></a>root_file <span class="ot">&lt;-</span> root<span class="sc">$</span><span class="fu">make_fix_file</span>(<span class="st">&quot;C:</span><span class="sc">\\</span><span class="st">Users</span><span class="sc">\\</span><span class="st">User Name</span><span class="sc">\\</span><span class="st">...&quot;</span>)</span></code></pre></div>
-<p>As a last resort, you can get the path of standalone R scripts or vignettes using the <code>thisfile()</code> function:</p>
+<p>As a last resort, you can get the path of standalone R scripts or
+vignettes using the <code>thisfile()</code> function:</p>
 <div class="sourceCode" id="cb20"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb20-1"><a href="#cb20-1" aria-hidden="true" tabindex="-1"></a>root_file <span class="ot">&lt;-</span> root<span class="sc">$</span><span class="fu">make_fix_file</span>(<span class="fu">dirname</span>(<span class="fu">thisfile</span>()))</span></code></pre></div>
-<p>The remainder of this vignette describes implementation details and advanced features.</p>
+<p>The remainder of this vignette describes implementation details and
+advanced features.</p>
 </div>
 <div id="project-root" class="section level2">
 <h2>Project root</h2>
-<p>We assume a self-contained project where all files and directories are located below a common <em>root</em> directory. Also, there should be a way to unambiguously identify this root directory. (Often, the root contains a regular file whose name matches a given pattern, and/or whose contents match another pattern.) In this case, the following method reliably finds our project root:</p>
+<p>We assume a self-contained project where all files and directories
+are located below a common <em>root</em> directory. Also, there should
+be a way to unambiguously identify this root directory. (Often, the root
+contains a regular file whose name matches a given pattern, and/or whose
+contents match another pattern.) In this case, the following method
+reliably finds our project root:</p>
 <ul>
 <li>Start the search in any subdirectory of our project</li>
-<li>Proceed up the directory hierarchy until the root directory has been identified</li>
+<li>Proceed up the directory hierarchy until the root directory has been
+identified</li>
 </ul>
-<p>The Git version control system (and probably many other tools) use a similar approach: A Git command can be executed from within any subdirectory of a repository.</p>
+<p>The Git version control system (and probably many other tools) use a
+similar approach: A Git command can be executed from within any
+subdirectory of a repository.</p>
 <div id="a-simple-example" class="section level3">
 <h3>A simple example</h3>
-<p>The <code>find_root()</code> function implements the core functionality. It returns the path to the first directory that matches the filtering criteria, or throws an error if there is no such directory. Filtering criteria are constructed in a generic fashion using the <code>root_criterion()</code> function, the <code>has_file()</code> function constructs a criterion that checks for the presence of a file with a specific name and specific contents.</p>
+<p>The <code>find_root()</code> function implements the core
+functionality. It returns the path to the first directory that matches
+the filtering criteria, or throws an error if there is no such
+directory. Filtering criteria are constructed in a generic fashion using
+the <code>root_criterion()</code> function, the <code>has_file()</code>
+function constructs a criterion that checks for the presence of a file
+with a specific name and specific contents.</p>
 <div class="sourceCode" id="cb21"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb21-1"><a href="#cb21-1" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(rprojroot)</span>
 <span id="cb21-2"><a href="#cb21-2" aria-hidden="true" tabindex="-1"></a></span>
 <span id="cb21-3"><a href="#cb21-3" aria-hidden="true" tabindex="-1"></a><span class="co"># List all files and directories below the root</span></span>
@@ -216,49 +451,73 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
 <pre><code>##  [1] &quot;DESCRIPTION&quot;      &quot;LICENSE&quot;          &quot;LICENSE.md&quot;       &quot;NAMESPACE&quot;       
 ##  [5] &quot;NEWS.md&quot;          &quot;R&quot;                &quot;README.Rmd&quot;       &quot;README.md&quot;       
 ##  [9] &quot;TODO.md&quot;          &quot;_pkgdown.yml&quot;     &quot;codecov.yml&quot;      &quot;cran-comments.md&quot;
-## [13] &quot;inst&quot;             &quot;man&quot;              &quot;revdep&quot;           &quot;rprojroot.Rcheck&quot;
-## [17] &quot;rprojroot.Rproj&quot;  &quot;tests&quot;            &quot;vignettes&quot;</code></pre>
+## [13] &quot;inst&quot;             &quot;man&quot;              &quot;revdep&quot;           &quot;rprojroot.Rproj&quot; 
+## [17] &quot;tests&quot;            &quot;vignettes&quot;</code></pre>
 <div id="relative-paths-to-a-stable-root" class="section level4">
 <h4>Relative paths to a stable root</h4>
-<p>Here we illustrate the power of <em>rprojroot</em> by demonstrating how to access the same file from two different working directories. Let your project be a package called <code>pkgname</code> and consider the desired file <code>rrmake.R</code> at <code>pkgname/R/rrmake.R</code>. First, we show how to access from the <code>vignettes</code> directory, and then from the <code>tests/testthat</code> directory.</p>
+<p>Here we illustrate the power of <em>rprojroot</em> by demonstrating
+how to access the same file from two different working directories. Let
+your project be a package called <code>pkgname</code> and consider the
+desired file <code>rrmake.R</code> at <code>pkgname/R/rrmake.R</code>.
+First, we show how to access from the <code>vignettes</code> directory,
+and then from the <code>tests/testthat</code> directory.</p>
 <div id="example-a-from-vignettes" class="section level5">
 <h5>Example A: From <code>vignettes</code></h5>
-<p>When your working directory is <code>pkgname/vignettes</code>, you can access the <code>rrmake.R</code> file by:</p>
+<p>When your working directory is <code>pkgname/vignettes</code>, you
+can access the <code>rrmake.R</code> file by:</p>
 <ol style="list-style-type: decimal">
-<li>Supplying a pathname relative to your working directory. Here’s two ways to do that:</li>
+<li>Supplying a pathname relative to your working directory. Here’s two
+ways to do that:</li>
 </ol>
 <div class="sourceCode" id="cb23"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb23-1"><a href="#cb23-1" aria-hidden="true" tabindex="-1"></a>rel_path_from_vignettes <span class="ot">&lt;-</span> <span class="st">&quot;../R/rrmake.R&quot;</span></span>
 <span id="cb23-2"><a href="#cb23-2" aria-hidden="true" tabindex="-1"></a>rel_path_from_vignettes <span class="ot">&lt;-</span> <span class="fu">file.path</span>(<span class="st">&quot;..&quot;</span>, <span class="st">&quot;R&quot;</span>, <span class="st">&quot;rrmake.R&quot;</span>) <span class="do">##identical</span></span></code></pre></div>
 <ol start="2" style="list-style-type: decimal">
-<li>Supplying a pathname to the file relative from the root of the package, e.g.,</li>
+<li>Supplying a pathname to the file relative from the root of the
+package, e.g.,</li>
 </ol>
 <div class="sourceCode" id="cb24"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb24-1"><a href="#cb24-1" aria-hidden="true" tabindex="-1"></a>rel_path_from_root <span class="ot">&lt;-</span> <span class="st">&quot;R/rrmake.R&quot;</span></span>
 <span id="cb24-2"><a href="#cb24-2" aria-hidden="true" tabindex="-1"></a>rel_path_from_root <span class="ot">&lt;-</span> <span class="fu">file.path</span>(<span class="st">&quot;R&quot;</span>, <span class="st">&quot;rrmake.R&quot;</span>) <span class="do">##identical</span></span></code></pre></div>
-<p>This second method requires finding the root of the package, which can be done with the <code>has_file()</code> function:</p>
+<p>This second method requires finding the root of the package, which
+can be done with the <code>has_file()</code> function:</p>
 <div class="sourceCode" id="cb25"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb25-1"><a href="#cb25-1" aria-hidden="true" tabindex="-1"></a><span class="fu">has_file</span>(<span class="st">&quot;DESCRIPTION&quot;</span>)</span></code></pre></div>
 <pre><code>## Root criterion: contains a file &quot;DESCRIPTION&quot;</code></pre>
-<p>So, using <em>rprojroot</em> you can specify the path relative from root in the following manner:</p>
+<p>So, using <em>rprojroot</em> you can specify the path relative from
+root in the following manner:</p>
 <div class="sourceCode" id="cb27"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb27-1"><a href="#cb27-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Specify a path/to/file relative to the root</span></span>
 <span id="cb27-2"><a href="#cb27-2" aria-hidden="true" tabindex="-1"></a>rel_path_from_root <span class="ot">&lt;-</span> <span class="fu">find_root_file</span>(<span class="st">&quot;R&quot;</span>, <span class="st">&quot;rrmake.R&quot;</span>, <span class="at">criterion =</span> <span class="fu">has_file</span>(<span class="st">&quot;DESCRIPTION&quot;</span>))</span></code></pre></div>
 </div>
 <div id="example-b-from-teststestthat" class="section level5">
 <h5>Example B: From <code>tests/testthat</code></h5>
-<p>When your working directory is <code>pkgname/tests/testthat</code>, you can access the <code>rrmake.R</code> file by:</p>
+<p>When your working directory is <code>pkgname/tests/testthat</code>,
+you can access the <code>rrmake.R</code> file by:</p>
 <ol style="list-style-type: decimal">
 <li>Supplying a pathname relative to your working directory.</li>
 </ol>
 <div class="sourceCode" id="cb28"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb28-1"><a href="#cb28-1" aria-hidden="true" tabindex="-1"></a>rel_path_from_testthat <span class="ot">&lt;-</span> <span class="st">&quot;../../R/rrmake.R&quot;</span></span></code></pre></div>
-<p>Note that this is different than in the previous example! However, the second method is the same…</p>
+<p>Note that this is different than in the previous example! However,
+the second method is the same…</p>
 <ol start="2" style="list-style-type: decimal">
-<li>Supplying a pathname to the file relative from the root of the package. With <em>rprojroot</em>, this is the exact same as in the previous example.</li>
+<li>Supplying a pathname to the file relative from the root of the
+package. With <em>rprojroot</em>, this is the exact same as in the
+previous example.</li>
 </ol>
 <div class="sourceCode" id="cb29"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb29-1"><a href="#cb29-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Specify a path/to/file relative to the root</span></span>
 <span id="cb29-2"><a href="#cb29-2" aria-hidden="true" tabindex="-1"></a>rel_path_from_root <span class="ot">&lt;-</span> <span class="fu">find_root_file</span>(<span class="st">&quot;R&quot;</span>, <span class="st">&quot;rrmake.R&quot;</span>, <span class="at">criterion =</span> <span class="fu">has_file</span>(<span class="st">&quot;DESCRIPTION&quot;</span>))</span></code></pre></div>
 </div>
 <div id="summary-of-examples-a-and-b" class="section level5">
 <h5>Summary of Examples A and B</h5>
-<p>Since Examples A and B used different working directories, <code>rel_path_from_vignettes</code> and <code>rel_path_from_testthat</code> were different. This is an issue when trying to re-use the same code. This issue is solved by using <em>rprojroot</em>: the function <code>find_root_file()</code> finds a file relative from the root, where the root is determined from checking the criterion with <code>has_file()</code>.</p>
-<p>Note that the follow code produces identical results when building the vignette <em>and</em> when sourcing the chunk in RStudio, provided that the current working directory is the project root or anywhere below. So, we can check to make sure that <em>rprojroot</em> has successfully determined the correct path:</p>
+<p>Since Examples A and B used different working directories,
+<code>rel_path_from_vignettes</code> and
+<code>rel_path_from_testthat</code> were different. This is an issue
+when trying to re-use the same code. This issue is solved by using
+<em>rprojroot</em>: the function <code>find_root_file()</code> finds a
+file relative from the root, where the root is determined from checking
+the criterion with <code>has_file()</code>.</p>
+<p>Note that the follow code produces identical results when building
+the vignette <em>and</em> when sourcing the chunk in RStudio, provided
+that the current working directory is the project root or anywhere
+below. So, we can check to make sure that <em>rprojroot</em> has
+successfully determined the correct path:</p>
 <div class="sourceCode" id="cb30"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb30-1"><a href="#cb30-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Specify a path/to/file relative to the root</span></span>
 <span id="cb30-2"><a href="#cb30-2" aria-hidden="true" tabindex="-1"></a>rel_path_from_root <span class="ot">&lt;-</span> <span class="fu">find_root_file</span>(<span class="st">&quot;R&quot;</span>, <span class="st">&quot;rrmake.R&quot;</span>, <span class="at">criterion =</span> <span class="fu">has_file</span>(<span class="st">&quot;DESCRIPTION&quot;</span>))</span>
 <span id="cb30-3"><a href="#cb30-3" aria-hidden="true" tabindex="-1"></a></span>
@@ -270,13 +529,19 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
 </div>
 <div id="criteria" class="section level3">
 <h3>Criteria</h3>
-<p>The <code>has_file()</code> function (and the more general <code>root_criterion()</code>) both return an S3 object of class <code>root_criterion</code>:</p>
+<p>The <code>has_file()</code> function (and the more general
+<code>root_criterion()</code>) both return an S3 object of class
+<code>root_criterion</code>:</p>
 <div class="sourceCode" id="cb32"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb32-1"><a href="#cb32-1" aria-hidden="true" tabindex="-1"></a><span class="fu">has_file</span>(<span class="st">&quot;DESCRIPTION&quot;</span>)</span></code></pre></div>
 <pre><code>## Root criterion: contains a file &quot;DESCRIPTION&quot;</code></pre>
-<p>In addition, character values are coerced to <code>has_file</code> criteria by default, this coercion is applied automatically by <code>find_root()</code>. (This feature is used by the introductory example.)</p>
+<p>In addition, character values are coerced to <code>has_file</code>
+criteria by default, this coercion is applied automatically by
+<code>find_root()</code>. (This feature is used by the introductory
+example.)</p>
 <div class="sourceCode" id="cb34"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb34-1"><a href="#cb34-1" aria-hidden="true" tabindex="-1"></a><span class="fu">as_root_criterion</span>(<span class="st">&quot;DESCRIPTION&quot;</span>)</span></code></pre></div>
 <pre><code>## Root criterion: contains a file &quot;DESCRIPTION&quot;</code></pre>
-<p>The return value of these functions can be stored and reused; in fact, the package provides 10 such criteria:</p>
+<p>The return value of these functions can be stored and reused; in
+fact, the package provides 10 such criteria:</p>
 <div class="sourceCode" id="cb36"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb36-1"><a href="#cb36-1" aria-hidden="true" tabindex="-1"></a>criteria</span></code></pre></div>
 <pre><code>## $is_rstudio_project
 ## Root criterion: contains a file matching &quot;[.]Rproj$&quot; with contents matching &quot;^Version: &quot; in the first line
@@ -334,12 +599,15 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
 </div>
 <div id="shortcuts" class="section level3">
 <h3>Shortcuts</h3>
-<p>To avoid specifying the search criteria for the project root every time, shortcut functions can be created. The <code>find_package_root_file()</code> is a shortcut for <code>find_root_file(..., criterion = is_r_package)</code>:</p>
+<p>To avoid specifying the search criteria for the project root every
+time, shortcut functions can be created. The
+<code>find_package_root_file()</code> is a shortcut for
+<code>find_root_file(..., criterion = is_r_package)</code>:</p>
 <div class="sourceCode" id="cb44"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb44-1"><a href="#cb44-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Print first lines of the source for this document</span></span>
 <span id="cb44-2"><a href="#cb44-2" aria-hidden="true" tabindex="-1"></a><span class="fu">head</span>(<span class="fu">readLines</span>(<span class="fu">find_package_root_file</span>(<span class="st">&quot;vignettes&quot;</span>, <span class="st">&quot;rprojroot.Rmd&quot;</span>)))</span></code></pre></div>
 <pre><code>## [1] &quot;---&quot;                                               
 ## [2] &quot;title: \&quot;Finding files in project subdirectories\&quot;&quot;
-## [3] &quot;author: \&quot;Kirill Müller\&quot;&quot;                         
+## [3] &quot;author: \&quot;Kirill M\303\274ller\&quot;&quot;                  
 ## [4] &quot;date: \&quot;`r Sys.Date()`\&quot;&quot;                          
 ## [5] &quot;output: rmarkdown::html_vignette&quot;                  
 ## [6] &quot;vignette: &gt;&quot;</code></pre>
@@ -349,7 +617,10 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
 <span id="cb46-3"><a href="#cb46-3" aria-hidden="true" tabindex="-1"></a><span class="co"># Use a shorter alias</span></span>
 <span id="cb46-4"><a href="#cb46-4" aria-hidden="true" tabindex="-1"></a><span class="fu">file.exists</span>(<span class="fu">P</span>(<span class="st">&quot;vignettes&quot;</span>, <span class="st">&quot;rprojroot.Rmd&quot;</span>))</span></code></pre></div>
 <pre><code>## [1] TRUE</code></pre>
-<p>Each criterion actually contains a function that allows finding a file below the root specified by this criterion. As our project does not have a file named <code>LICENSE</code>, querying the root results in an error:</p>
+<p>Each criterion actually contains a function that allows finding a
+file below the root specified by this criterion. As our project does not
+have a file named <code>LICENSE</code>, querying the root results in an
+error:</p>
 <div class="sourceCode" id="cb48"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb48-1"><a href="#cb48-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Use the has_license criterion to find the root</span></span>
 <span id="cb48-2"><a href="#cb48-2" aria-hidden="true" tabindex="-1"></a>R <span class="ot">&lt;-</span> has_license<span class="sc">$</span>find_file</span>
 <span id="cb48-3"><a href="#cb48-3" aria-hidden="true" tabindex="-1"></a>R</span></code></pre></div>
@@ -357,48 +628,70 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
 ## {
 ##     find_root_file(..., criterion = criterion, path = path)
 ## }
-## &lt;environment: 0x133662660&gt;</code></pre>
+## &lt;environment: 0x55a10774fe08&gt;</code></pre>
 <div class="sourceCode" id="cb50"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb50-1"><a href="#cb50-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Our package does not have a LICENSE file, trying to find the root results in an error</span></span>
 <span id="cb50-2"><a href="#cb50-2" aria-hidden="true" tabindex="-1"></a><span class="fu">R</span>()</span></code></pre></div>
-<pre><code>## [1] &quot;/private/var/folders/cw/805_99kx0lq50gkr0hr81_y40000gp/T/RtmpEhraT2/Rbuild83a746987ce6/rprojroot&quot;</code></pre>
+<pre><code>## [1] &quot;/tmp/RtmpLwxMM2/Rbuild6a601db175c8/rprojroot&quot;</code></pre>
 </div>
 <div id="fixed-root" class="section level3">
 <h3>Fixed root</h3>
-<p>We can also create a function that computes a path relative to the root <em>at creation time</em>.</p>
+<p>We can also create a function that computes a path relative to the
+root <em>at creation time</em>.</p>
 <div class="sourceCode" id="cb52"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb52-1"><a href="#cb52-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Define a function that computes file paths below the current root</span></span>
 <span id="cb52-2"><a href="#cb52-2" aria-hidden="true" tabindex="-1"></a>F <span class="ot">&lt;-</span> is_r_package<span class="sc">$</span><span class="fu">make_fix_file</span>()</span>
 <span id="cb52-3"><a href="#cb52-3" aria-hidden="true" tabindex="-1"></a>F</span>
 <span id="cb52-4"><a href="#cb52-4" aria-hidden="true" tabindex="-1"></a></span>
 <span id="cb52-5"><a href="#cb52-5" aria-hidden="true" tabindex="-1"></a><span class="co"># Show contents of the NAMESPACE file in our project</span></span>
 <span id="cb52-6"><a href="#cb52-6" aria-hidden="true" tabindex="-1"></a><span class="fu">readLines</span>(<span class="fu">F</span>(<span class="st">&quot;NAMESPACE&quot;</span>))</span></code></pre></div>
-<p>This is a more robust alternative to <code>$find_file()</code>, because it <em>fixes</em> the project directory when <code>$make_fix_file()</code> is called, instead of searching for it every time. (For that reason it is also slightly faster, but I doubt this matters in practice.)</p>
-<p>This function can be used even if we later change the working directory to somewhere outside the project:</p>
+<p>This is a more robust alternative to <code>$find_file()</code>,
+because it <em>fixes</em> the project directory when
+<code>$make_fix_file()</code> is called, instead of searching for it
+every time. (For that reason it is also slightly faster, but I doubt
+this matters in practice.)</p>
+<p>This function can be used even if we later change the working
+directory to somewhere outside the project:</p>
 <div class="sourceCode" id="cb53"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb53-1"><a href="#cb53-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Print the size of the namespace file, working directory outside the project</span></span>
 <span id="cb53-2"><a href="#cb53-2" aria-hidden="true" tabindex="-1"></a>withr<span class="sc">::</span><span class="fu">with_dir</span>(</span>
 <span id="cb53-3"><a href="#cb53-3" aria-hidden="true" tabindex="-1"></a>  <span class="st">&quot;../..&quot;</span>,</span>
 <span id="cb53-4"><a href="#cb53-4" aria-hidden="true" tabindex="-1"></a>  <span class="fu">file.size</span>(<span class="fu">F</span>(<span class="st">&quot;NAMESPACE&quot;</span>))</span>
 <span id="cb53-5"><a href="#cb53-5" aria-hidden="true" tabindex="-1"></a>)</span></code></pre></div>
-<p>The <code>make_fix_file()</code> member function also accepts an optional <code>path</code> argument, in case you know your project’s root but the current working directory is somewhere outside. The path to the current script or <code>knitr</code> document can be obtained using the <code>thisfile()</code> function, but it’s much easier and much more robust to just run your scripts with the working directory somewhere below your project root.</p>
+<p>The <code>make_fix_file()</code> member function also accepts an
+optional <code>path</code> argument, in case you know your project’s
+root but the current working directory is somewhere outside. The path to
+the current script or <code>knitr</code> document can be obtained using
+the <code>thisfile()</code> function, but it’s much easier and much more
+robust to just run your scripts with the working directory somewhere
+below your project root.</p>
 </div>
 </div>
 <div id="testthat-files" class="section level2">
 <h2><code>testthat</code> files</h2>
-<p>Tests run with <a href="https://cran.r-project.org/package=testthat"><code>testthat</code></a> commonly use files that live below the <code>tests/testthat</code> directory. Ideally, this should work in the following situation:</p>
+<p>Tests run with <a href="https://cran.r-project.org/package=testthat"><code>testthat</code></a>
+commonly use files that live below the <code>tests/testthat</code>
+directory. Ideally, this should work in the following situation:</p>
 <ul>
 <li>During package development (working directory: package root)</li>
-<li>When testing with <code>devtools::test()</code> (working directory: <code>tests/testthat</code>)</li>
-<li>When running <code>R CMD check</code> (working directory: a renamed recursive copy of <code>tests</code>)</li>
+<li>When testing with <code>devtools::test()</code> (working directory:
+<code>tests/testthat</code>)</li>
+<li>When running <code>R CMD check</code> (working directory: a renamed
+recursive copy of <code>tests</code>)</li>
 </ul>
-<p>The <code>is_testthat</code> criterion allows robust lookup of test files.</p>
+<p>The <code>is_testthat</code> criterion allows robust lookup of test
+files.</p>
 <div class="sourceCode" id="cb54"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb54-1"><a href="#cb54-1" aria-hidden="true" tabindex="-1"></a>is_testthat</span></code></pre></div>
 <pre><code>## Root criterion: directory name is &quot;testthat&quot; (also look in subdirectories: `tests/testthat`, `testthat`)</code></pre>
-<p>The example code below lists all files in the <a href="https://github.com/r-lib/rprojroot/tree/main/tests/testthat/hierarchy">hierarchy</a> test directory. It uses two project root lookups in total, so that it also works when rendering the vignette (<em>sigh</em>):</p>
+<p>The example code below lists all files in the <a href="https://github.com/r-lib/rprojroot/tree/main/tests/testthat/hierarchy">hierarchy</a>
+test directory. It uses two project root lookups in total, so that it
+also works when rendering the vignette (<em>sigh</em>):</p>
 <div class="sourceCode" id="cb56"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb56-1"><a href="#cb56-1" aria-hidden="true" tabindex="-1"></a><span class="fu">dir</span>(is_testthat<span class="sc">$</span><span class="fu">find_file</span>(<span class="st">&quot;hierarchy&quot;</span>, <span class="at">path =</span> is_r_package<span class="sc">$</span><span class="fu">find_file</span>()))</span></code></pre></div>
 <pre><code>## [1] &quot;DESCRIPTION&quot;     &quot;a&quot;               &quot;b&quot;               &quot;c&quot;              
 ## [5] &quot;hierarchy.Rproj&quot;</code></pre>
 <div id="another-example-custom-testing-utilities" class="section level3">
 <h3>Another example: custom testing utilities</h3>
-<p>The hassle of using saved data files for testing is made even easier by using <em>rprojroot</em> in a utility function. For example, suppose you have a testing file at <code>tests/testthat/test_my_fun.R</code> which tests the <code>my_fun()</code> function:</p>
+<p>The hassle of using saved data files for testing is made even easier
+by using <em>rprojroot</em> in a utility function. For example, suppose
+you have a testing file at <code>tests/testthat/test_my_fun.R</code>
+which tests the <code>my_fun()</code> function:</p>
 <div class="sourceCode" id="cb58"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb58-1"><a href="#cb58-1" aria-hidden="true" tabindex="-1"></a>my_fun_run <span class="ot">&lt;-</span> <span class="fu">do.call</span>(my_fun, my_args)</span>
 <span id="cb58-2"><a href="#cb58-2" aria-hidden="true" tabindex="-1"></a></span>
 <span id="cb58-3"><a href="#cb58-3" aria-hidden="true" tabindex="-1"></a>testthat<span class="sc">::</span><span class="fu">test_that</span>(</span>
@@ -408,15 +701,29 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
 <span id="cb58-7"><a href="#cb58-7" aria-hidden="true" tabindex="-1"></a>    expected_output</span>
 <span id="cb58-8"><a href="#cb58-8" aria-hidden="true" tabindex="-1"></a>  )</span>
 <span id="cb58-9"><a href="#cb58-9" aria-hidden="true" tabindex="-1"></a>)</span></code></pre></div>
-<p>There are two pieces of information that you’ll need every time <code>test_my_fun.R</code> is run: <code>my_args</code> and <code>expected_output</code>. Typically, these objects are saved to <code>.Rdata</code> files and saved to the same subdirectory. For example, you could save them to <code>my_args.Rdata</code> and <code>expected_output.Rdata</code> under the <code>tests/testthat/testing_data</code> subdirectory. And, to find them easily in any contexts, you can use <em>rprojroot</em>!</p>
-<p>Since all of the data files live in the same subdirectory, you can create a utility function <code>get_my_path()</code> that will always look in that directory for these types of files. And, since the <em>testthat</em> package will look for and source the <code>tests/testthat/helper.R</code> file before running any tests, you can place a <code>get_my_path()</code> in this file and use it throughout your tests:</p>
+<p>There are two pieces of information that you’ll need every time
+<code>test_my_fun.R</code> is run: <code>my_args</code> and
+<code>expected_output</code>. Typically, these objects are saved to
+<code>.Rdata</code> files and saved to the same subdirectory. For
+example, you could save them to <code>my_args.Rdata</code> and
+<code>expected_output.Rdata</code> under the
+<code>tests/testthat/testing_data</code> subdirectory. And, to find them
+easily in any contexts, you can use <em>rprojroot</em>!</p>
+<p>Since all of the data files live in the same subdirectory, you can
+create a utility function <code>get_my_path()</code> that will always
+look in that directory for these types of files. And, since the
+<em>testthat</em> package will look for and source the
+<code>tests/testthat/helper.R</code> file before running any tests, you
+can place a <code>get_my_path()</code> in this file and use it
+throughout your tests:</p>
 <div class="sourceCode" id="cb59"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb59-1"><a href="#cb59-1" aria-hidden="true" tabindex="-1"></a><span class="do">## saved to tests/testthat/helper.R</span></span>
 <span id="cb59-2"><a href="#cb59-2" aria-hidden="true" tabindex="-1"></a>get_my_path <span class="ot">&lt;-</span> <span class="cf">function</span>(file_name) {</span>
 <span id="cb59-3"><a href="#cb59-3" aria-hidden="true" tabindex="-1"></a>  rprojroot<span class="sc">::</span><span class="fu">find_testthat_root_file</span>(</span>
 <span id="cb59-4"><a href="#cb59-4" aria-hidden="true" tabindex="-1"></a>    <span class="st">&quot;testing_data&quot;</span>, filename</span>
 <span id="cb59-5"><a href="#cb59-5" aria-hidden="true" tabindex="-1"></a>  )</span>
 <span id="cb59-6"><a href="#cb59-6" aria-hidden="true" tabindex="-1"></a>}</span></code></pre></div>
-<p>Now you can ask <code>get_my_path()</code> to find your important data files by using the function within your test scripts!</p>
+<p>Now you can ask <code>get_my_path()</code> to find your important
+data files by using the function within your test scripts!</p>
 <div class="sourceCode" id="cb60"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb60-1"><a href="#cb60-1" aria-hidden="true" tabindex="-1"></a><span class="do">## Find the correct path with your custom rprojroot helper function</span></span>
 <span id="cb60-2"><a href="#cb60-2" aria-hidden="true" tabindex="-1"></a>path_to_my_args_file <span class="ot">&lt;-</span> <span class="fu">get_my_path</span>(<span class="st">&quot;my_args.Rdata&quot;</span>)</span>
 <span id="cb60-3"><a href="#cb60-3" aria-hidden="true" tabindex="-1"></a></span>
@@ -437,16 +744,25 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
 <span id="cb60-18"><a href="#cb60-18" aria-hidden="true" tabindex="-1"></a>    expected_output</span>
 <span id="cb60-19"><a href="#cb60-19" aria-hidden="true" tabindex="-1"></a>  )</span>
 <span id="cb60-20"><a href="#cb60-20" aria-hidden="true" tabindex="-1"></a>)</span></code></pre></div>
-<p>For an example in the wild, see the <a href="https://github.com/tidyverse/readxl/blob/0d9ad4f570f6580ff716e0e9ba5048447048e9f0/tests/testthat/helper.R#L1-L3"><code>test_sheet()</code> function</a> in the <em>readxl</em> package.</p>
+<p>For an example in the wild, see the <a href="https://github.com/tidyverse/readxl/blob/0d9ad4f570f6580ff716e0e9ba5048447048e9f0/tests/testthat/helper.R#L1-L3"><code>test_sheet()</code>
+function</a> in the <em>readxl</em> package.</p>
 </div>
 </div>
 <div id="summary" class="section level2">
 <h2>Summary</h2>
-<p>The <em>rprojroot</em> package allows easy access to files below a project root if the project root can be identified easily, e.g. if it is the only directory in the whole hierarchy that contains a specific file. This is a robust solution for finding files in largish projects with a subdirectory hierarchy if the current working directory cannot be assumed fixed. (However, at least initially, the current working directory must be somewhere below the project root.)</p>
+<p>The <em>rprojroot</em> package allows easy access to files below a
+project root if the project root can be identified easily, e.g. if it is
+the only directory in the whole hierarchy that contains a specific file.
+This is a robust solution for finding files in largish projects with a
+subdirectory hierarchy if the current working directory cannot be
+assumed fixed. (However, at least initially, the current working
+directory must be somewhere below the project root.)</p>
 </div>
 <div id="acknowledgement" class="section level2">
 <h2>Acknowledgement</h2>
-<p>This package was inspired by the gist <a href="https://gist.github.com/jennybc/362f52446fe1ebc4c49f">“Stop the working directory insanity”</a> by Jennifer Bryan, and by the way Git knows where its files are.</p>
+<p>This package was inspired by the gist <a href="https://gist.github.com/jennybc/362f52446fe1ebc4c49f">“Stop the
+working directory insanity”</a> by Jennifer Bryan, and by the way Git
+knows where its files are.</p>
 </div>
 
 

Debdiff

File lists identical (after any substitutions)

Control files: lines which differ (wdiff format)

  • Depends: r-base-core (>= 4.2.2-1), 4.2.0-1~jan+unchanged1), r-api-4.0

More details

Full run details