-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanalysis-package-layout.html
More file actions
494 lines (466 loc) · 19.8 KB
/
analysis-package-layout.html
File metadata and controls
494 lines (466 loc) · 19.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Analysis Package Layout • rdev</title>
<!-- favicons --><link rel="icon" type="image/png" sizes="96x96" href="../favicon-96x96.png">
<link rel="icon" type="”image/svg+xml”" href="../favicon.svg">
<link rel="apple-touch-icon" sizes="180x180" href="../apple-touch-icon.png">
<link rel="icon" sizes="any" href="../favicon.ico">
<link rel="manifest" href="../site.webmanifest">
<script src="../lightswitch.js"></script><script src="../deps/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="../deps/bootstrap-5.3.1/bootstrap.min.css" rel="stylesheet">
<script src="../deps/bootstrap-5.3.1/bootstrap.bundle.min.js"></script><link href="../deps/font-awesome-6.5.2/css/all.min.css" rel="stylesheet">
<link href="../deps/font-awesome-6.5.2/css/v4-shims.min.css" rel="stylesheet">
<script src="../deps/headroom-0.11.0/headroom.min.js"></script><script src="../deps/headroom-0.11.0/jQuery.headroom.min.js"></script><script src="../deps/bootstrap-toc-1.0.1/bootstrap-toc.min.js"></script><script src="../deps/clipboard.js-2.0.11/clipboard.min.js"></script><script src="../deps/search-1.0.0/autocomplete.jquery.min.js"></script><script src="../deps/search-1.0.0/fuse.min.js"></script><script src="../deps/search-1.0.0/mark.min.js"></script><!-- pkgdown --><script src="../pkgdown.js"></script><link href="../extra.css" rel="stylesheet">
<meta property="og:title" content="Analysis Package Layout">
</head>
<body>
<a href="#main" class="visually-hidden-focusable">Skip to contents</a>
<nav class="navbar navbar-expand-lg fixed-top " aria-label="Site navigation"><div class="container">
<a class="navbar-brand me-2" href="../index.html">rdev</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.14.0</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div id="navbar" class="collapse navbar-collapse ms-3">
<ul class="navbar-nav me-auto">
<li class="nav-item"><a class="nav-link" href="../articles/rdev.html">Get started</a></li>
<li class="nav-item"><a class="nav-link" href="../reference/index.html">Reference</a></li>
<li class="active nav-item dropdown">
<button class="nav-link dropdown-toggle" type="button" id="dropdown-articles" data-bs-toggle="dropdown" aria-expanded="false" aria-haspopup="true">Articles</button>
<ul class="dropdown-menu" aria-labelledby="dropdown-articles">
<li><a class="dropdown-item" href="../articles/analysis-package-layout.html">Analysis Package Layout</a></li>
<li><a class="dropdown-item" href="../articles/style-guide.html">Style Guide</a></li>
</ul>
</li>
<li class="nav-item"><a class="nav-link" href="../news/index.html">Changelog</a></li>
</ul>
<ul class="navbar-nav">
<li class="nav-item"><form class="form-inline" role="search">
<input class="form-control" type="search" name="search-input" id="search-input" autocomplete="off" aria-label="Search site" placeholder="Search for" data-search-index="../search.json">
</form></li>
<li class="nav-item"><a class="external-link nav-link" href="https://github.com/jabenninghoff/rdev/" aria-label="GitHub"><span class="fa fab fa-github fa-lg"></span></a></li>
<li class="nav-item dropdown">
<button class="nav-link dropdown-toggle" type="button" id="dropdown-lightswitch" data-bs-toggle="dropdown" aria-expanded="false" aria-haspopup="true" aria-label="Light switch"><span class="fa fa-sun"></span></button>
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="dropdown-lightswitch">
<li><button class="dropdown-item" data-bs-theme-value="light"><span class="fa fa-sun"></span> Light</button></li>
<li><button class="dropdown-item" data-bs-theme-value="dark"><span class="fa fa-moon"></span> Dark</button></li>
<li><button class="dropdown-item" data-bs-theme-value="auto"><span class="fa fa-adjust"></span> Auto</button></li>
</ul>
</li>
</ul>
</div>
</div>
</nav><div class="container template-article">
<div class="row">
<main id="main" class="col-md-9"><div class="page-header">
<img src="../logo.png" class="logo" alt=""><h1>Analysis Package Layout</h1>
<small class="dont-index">Source: <a href="https://github.com/jabenninghoff/rdev/blob/HEAD/vignettes/analysis-package-layout.Rmd" class="external-link"><code>vignettes/analysis-package-layout.Rmd</code></a></small>
<div class="d-none name"><code>analysis-package-layout.Rmd</code></div>
</div>
<p>R Analysis Packages are an extension of the standard R package layout
designed to support publishing a collection of R notebooks used for data
analysis as static html, typically using <a href="https://pages.github.com" class="external-link">GitHub Pages</a>.</p>
<p><a href="https://bookdown.org/yihui/rmarkdown/notebook.html" class="external-link">R
Notebooks</a> include a YAML header and <a href="https://github.com/rstudio/rmarkdown" class="external-link">R Markdown</a> body. The
Analysis Package Layout follows the convention that the first non-blank
line in the body of an R notebook serves as a brief description of the
work. <code>rdev</code> includes an “Analysis Notebook” RStudio R
Markdown template (File > New File > Rmarkdown > From Template)
and a <code>README.Rmd</code> template optionally installed with
<code><a href="../reference/use_analysis_package.html">use_analysis_package()</a></code> that dynamically builds a list of
notebooks and descriptions when <a href="https://devtools.r-lib.org/reference/build_rmd.html" class="external-link"><code>devtools:build_readme()</code></a>
is run.</p>
<p>Starting in version 1.8.0, rdev also supports publishing Analysis
Notebooks using <a href="https://quarto.org" class="external-link">Quarto</a> as an
alternative to the original <code><a href="../reference/use_analysis_package.html">use_analysis_package()</a></code>.</p>
<p>rdev versions 1.10.2 and newer also support use of Quarto Documents
(<code>.qmd</code>) for Analysis Notebooks, although RStudio currently
doesn’t support <a href="https://github.com/rstudio/rstudio/issues/11316" class="external-link"><code>.qmd</code>
files as document templates</a>.</p>
<p>The table below documents the complete R Analysis Package layout:</p>
<ul>
<li>
<strong>Path</strong>: Path to the file or directory relative to the
package root</li>
<li>
<strong>R</strong>: Included in the R package definition</li>
<li>
<strong>g</strong>: Stored in git</li>
<li>
<strong>Function</strong>: The function of the file or
directory</li>
</ul>
<table class="table">
<colgroup>
<col width="13%">
<col width="1%">
<col width="1%">
<col width="82%">
</colgroup>
<thead><tr class="header">
<th align="left">Path</th>
<th align="left">R</th>
<th align="left">g</th>
<th align="left">Function</th>
</tr></thead>
<tbody>
<tr class="odd">
<td align="left">.Rbuildignore</td>
<td align="left"></td>
<td align="left"><code>x</code></td>
<td align="left">Files excluded from the package, sorted using
<code><a href="../reference/sort_rbuildignore.html">sort_rbuildignore()</a></code>
</td>
</tr>
<tr class="even">
<td align="left">.RData</td>
<td align="left"></td>
<td align="left"></td>
<td align="left">Saved workspace - not used</td>
</tr>
<tr class="odd">
<td align="left">.Rhistory</td>
<td align="left"></td>
<td align="left"></td>
<td align="left">R command history</td>
</tr>
<tr class="even">
<td align="left">.Rprofile</td>
<td align="left"></td>
<td align="left"><code>x</code></td>
<td align="left">Used by <code>renv</code> and to <a href="https://r-pkgs.org/setup.html?#personal-startup-configuration" class="external-link">attach
development tools</a> and set project options</td>
</tr>
<tr class="odd">
<td align="left">.Rproj.user</td>
<td align="left"></td>
<td align="left"></td>
<td align="left">RStudio local project files</td>
</tr>
<tr class="even">
<td align="left">.git</td>
<td align="left"></td>
<td align="left"></td>
<td align="left">git version control</td>
</tr>
<tr class="odd">
<td align="left">.gitattributes</td>
<td align="left"></td>
<td align="left"><code>x</code></td>
<td align="left">Used to configure GitHub <a href="https://github.com/github-linguist/linguist" class="external-link">language
statistics</a>
</td>
</tr>
<tr class="even">
<td align="left">.github</td>
<td align="left"></td>
<td align="left"><code>x</code></td>
<td align="left">GitHub templates and workflows</td>
</tr>
<tr class="odd">
<td align="left">.gitignore</td>
<td align="left"></td>
<td align="left"><code>x</code></td>
<td align="left">git exclusions based on <a href="https://github.com/github/gitignore/blob/master/R.gitignore" class="external-link">GitHub
R</a>. Generated files outside of <code>docs</code> (used by GitHub
Pages) are excluded.</td>
</tr>
<tr class="even">
<td align="left">.lintr</td>
<td align="left"></td>
<td align="left"><code>x</code></td>
<td align="left">
<a href="https://lintr.r-lib.org/index.html" class="external-link">lintr</a>
configuration as described in the Style Guide,
<code><a href="../articles/style-guide.html">vignette("style-guide")</a></code>
</td>
</tr>
<tr class="odd">
<td align="left">.nojekyll</td>
<td align="left"></td>
<td align="left"><code>x</code></td>
<td align="left">
<a href="https://github.blog/news-insights/the-library/bypassing-jekyll-on-github-pages/" class="external-link">Disable</a>
Jekyll processing on <a href="https://pages.github.com" class="external-link">GitHub
Pages</a>
</td>
</tr>
<tr class="even">
<td align="left">.quarto</td>
<td align="left"></td>
<td align="left"></td>
<td align="left">Used by <a href="https://quarto.org" class="external-link">Quarto</a>
</td>
</tr>
<tr class="odd">
<td align="left">DESCRIPTION</td>
<td align="left"><code>x</code></td>
<td align="left"><code>x</code></td>
<td align="left">Package metadata. Use “Suggests” for development tools,
per <a href="https://rstudio.github.io/renv/articles/faq.html#how-should-i-handle-development-dependencies-" class="external-link">renv</a>
</td>
</tr>
<tr class="even">
<td align="left">LICENSE</td>
<td align="left"><code>x</code></td>
<td align="left"><code>x</code></td>
<td align="left">Generated with
<code><a href="https://usethis.r-lib.org/reference/licenses.html" class="external-link">usethis::use_mit_license()</a></code>
</td>
</tr>
<tr class="odd">
<td align="left">LICENSE.md</td>
<td align="left"></td>
<td align="left"><code>x</code></td>
<td align="left">See above, used by <a href="https://pkgdown.r-lib.org" class="external-link">pkgdown</a> and <a href="https://quarto.org" class="external-link">Quarto</a>
</td>
</tr>
<tr class="even">
<td align="left">NAMESPACE</td>
<td align="left"><code>x</code></td>
<td align="left"><code>x</code></td>
<td align="left">Automatically generated with <a href="https://roxygen2.r-lib.org" class="external-link">roxygen2</a>
</td>
</tr>
<tr class="odd">
<td align="left">NEWS.md</td>
<td align="left"><code>x</code></td>
<td align="left"><code>x</code></td>
<td align="left">Release notes, used by <code><a href="../reference/get_release.html">get_release()</a></code>, <a href="https://pkgdown.r-lib.org" class="external-link">pkgdown</a> and <a href="https://quarto.org" class="external-link">Quarto</a>
</td>
</tr>
<tr class="even">
<td align="left">R</td>
<td align="left"><code>x</code></td>
<td align="left"><code>x</code></td>
<td align="left">All project functions go here, with <a href="https://roxygen2.r-lib.org" class="external-link">roxygen2</a> comments</td>
</tr>
<tr class="odd">
<td align="left">README.Rmd</td>
<td align="left"></td>
<td align="left"><code>x</code></td>
<td align="left">Generated with <code><a href="https://usethis.r-lib.org/reference/use_readme_rmd.html" class="external-link">usethis::use_readme_md()</a></code> or
rdev template</td>
</tr>
<tr class="even">
<td align="left">README.md</td>
<td align="left"><code>x</code></td>
<td align="left"><code>x</code></td>
<td align="left">Generated with
<code><a href="https://devtools.r-lib.org/reference/build_rmd.html" class="external-link">devtools::build_readme()</a></code>
</td>
</tr>
<tr class="odd">
<td align="left">TODO.md</td>
<td align="left"><code>x</code></td>
<td align="left"><code>x</code></td>
<td align="left">To-do list, inspired by renv’s <a href="https://github.com/rstudio/renv/blob/99737730ea69730b211770ba2bfa78301cf0e7b2/TODO.md" class="external-link">historical
TODO.md</a>
</td>
</tr>
<tr class="even">
<td align="left">_freeze</td>
<td align="left"></td>
<td align="left"><code>x</code></td>
<td align="left">Used by the Quarto <a href="https://quarto.org/docs/projects/code-execution.html#freeze" class="external-link"><code>freeze</code></a>
option</td>
</tr>
<tr class="odd">
<td align="left">_pkgdown.yml</td>
<td align="left"></td>
<td align="left"><code>x</code></td>
<td align="left">
<a href="https://pkgdown.r-lib.org" class="external-link">pkgdown</a>
metadata, stored in the project root to make it more <a href="https://github.com/search?q=filename%3Apkgdown.yml+path%3A%2F&type=Code" class="external-link">discoverable</a>
(not used with Quarto)</td>
</tr>
<tr class="even">
<td align="left">_quarto.yml</td>
<td align="left"><code>x</code></td>
<td align="left"><code>x</code></td>
<td align="left">Quarto <a href="https://quarto.org/docs/projects/quarto-projects.html#project-metadata" class="external-link">configuration
file</a>
</td>
</tr>
<tr class="odd">
<td align="left">analysis</td>
<td align="left"><code>x</code></td>
<td align="left"><code>x</code></td>
<td align="left">Exploratory data analysis in R Notebooks, R
Presentations, and Quarto documents. Include functions from the R
directory using <code><a href="https://rdrr.io/r/base/library.html" class="external-link">library()</a></code>, not <code><a href="https://rdrr.io/r/base/source.html" class="external-link">source()</a></code>.</td>
</tr>
<tr class="even">
<td align="left">analysis/_metadata.yml</td>
<td align="left"><code>x</code></td>
<td align="left"><code>x</code></td>
<td align="left">Quarto <a href="https://quarto.org/docs/projects/quarto-projects.html#directory-metadata" class="external-link">directory
configuration file</a>
</td>
</tr>
<tr class="odd">
<td align="left">analysis/assets</td>
<td align="left"><code>x</code></td>
<td align="left"><code>x</code></td>
<td align="left">External assets (images, other files) included in R
Notebooks</td>
</tr>
<tr class="even">
<td align="left">analysis/data</td>
<td align="left"><code>x</code></td>
<td align="left"><code>x</code></td>
<td align="left">Used to store small data sets used for analysis and
exported data as <code>csv</code> files</td>
</tr>
<tr class="odd">
<td align="left">analysis/import</td>
<td align="left"></td>
<td align="left"></td>
<td align="left">Used for local storage of large data sets</td>
</tr>
<tr class="even">
<td align="left">analysis/rendered</td>
<td align="left"></td>
<td align="left"></td>
<td align="left">Manually rendered versions of <code>analysis/</code>
files to be included in <code>docs/</code>, like <a href="https://stackoverflow.com/questions/27930127/render-r-presentation-from-the-command-line" class="external-link">.Rpres
files</a>
</td>
</tr>
<tr class="odd">
<td align="left">changelog.qmd</td>
<td align="left"><code>x</code></td>
<td align="left"><code>x</code></td>
<td align="left">Quarto front-end to NEWS.md</td>
</tr>
<tr class="even">
<td align="left">demos</td>
<td align="left"><code>x</code></td>
<td align="left"></td>
<td align="left">Not used, as recommended by <a href="https://r-pkgs.org/misc.html" class="external-link">R Packages</a>
</td>
</tr>
<tr class="odd">
<td align="left">docs</td>
<td align="left"></td>
<td align="left"><code>x</code></td>
<td align="left">Used by <code><a href="../reference/build_analysis_site.html">build_analysis_site()</a></code> and
<code><a href="../reference/build_quarto_site.html">build_quarto_site()</a></code> to render the R Package and Notebooks
for GitHub Pages</td>
</tr>
<tr class="even">
<td align="left">exec</td>
<td align="left"><code>x</code></td>
<td align="left"></td>
<td align="left">Command line executable scripts - not used</td>
</tr>
<tr class="odd">
<td align="left">index.qmd</td>
<td align="left"><code>x</code></td>
<td align="left"><code>x</code></td>
<td align="left">Quarto home page, using the <a href="https://quarto.org/docs/websites/website-listings.html" class="external-link">listing
page</a> format</td>
</tr>
<tr class="even">
<td align="left">inst</td>
<td align="left"><code>x</code></td>
<td align="left"><code>x</code></td>
<td align="left">Installed files: templates and <a href="https://docs.ropensci.org/spelling/reference/wordlist.html" class="external-link">WORDLIST</a>
</td>
</tr>
<tr class="odd">
<td align="left">inst/bin</td>
<td align="left"><code>x</code></td>
<td align="left"><code>x</code></td>
<td align="left">Used for shell scripts that support development, like
<code>setup-r</code>
</td>
</tr>
<tr class="even">
<td align="left">inst/rmarkdown/templates</td>
<td align="left"><code>x</code></td>
<td align="left"><code>x</code></td>
<td align="left"><a href="https://rstudio.github.io/rstudio-extensions/rmarkdown_templates.html" class="external-link">R
Markdown Templates</a></td>
</tr>
<tr class="odd">
<td align="left">man</td>
<td align="left"><code>x</code></td>
<td align="left"><code>x</code></td>
<td align="left">Automatically generated with <a href="https://roxygen2.r-lib.org" class="external-link">roxygen2</a>
</td>
</tr>
<tr class="even">
<td align="left">package.Rproj</td>
<td align="left"></td>
<td align="left"><code>x</code></td>
<td align="left">Use the same name for the package, .Rproj, directory,
and GitHub repository</td>
</tr>
<tr class="odd">
<td align="left">pkgdown</td>
<td align="left"></td>
<td align="left"><code>x</code></td>
<td align="left">Store all <a href="https://pkgdown.r-lib.org" class="external-link">pkgdown</a> files here (not used with
Quarto)</td>
</tr>
<tr class="even">
<td align="left">po</td>
<td align="left"><code>x</code></td>
<td align="left"><code>x</code></td>
<td align="left">Used for <a href="https://cran.r-project.org/doc/manuals/r-devel/R-exts.html#Internationalization" class="external-link">Internationalization</a>
if needed</td>
</tr>
<tr class="odd">
<td align="left">renv</td>
<td align="left"></td>
<td align="left"><code>x</code></td>
<td align="left">Used by <a href="https://rstudio.github.io/renv/" class="external-link">renv</a>
</td>
</tr>
<tr class="even">
<td align="left">renv.lock</td>
<td align="left"></td>
<td align="left"><code>x</code></td>
<td align="left">renv <a href="https://rstudio.github.io/renv/reference/lockfiles.html" class="external-link">lockfile</a>
</td>
</tr>
<tr class="odd">
<td align="left">tests</td>
<td align="left"><code>x</code></td>
<td align="left"><code>x</code></td>
<td align="left">Tests using <a href="https://testthat.r-lib.org" class="external-link">testthat</a> and <a href="https://docs.ropensci.org/spelling/" class="external-link">spelling</a>
</td>
</tr>
<tr class="even">
<td align="left">tools</td>
<td align="left"><code>x</code></td>
<td align="left"></td>
<td align="left">Auxiliary files needed for building packages - not
used</td>
</tr>
<tr class="odd">
<td align="left">vignettes</td>
<td align="left"><code>x</code></td>
<td align="left"><code>x</code></td>
<td align="left">Package vignettes and articles, written in R
Markdown</td>
</tr>
</tbody>
</table></main>
</div>
<footer><div class="pkgdown-footer-left">
<p>Developed by John Benninghoff.</p>
</div>
<div class="pkgdown-footer-right">
<p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.1.3.</p>
</div>
</footer>
</div>
</body>
</html>