Skip to content

Commit c2aff3b

Browse files
authored
add data-raw section and refer to r-pkgs textbook (#135)
* add data-raw section and refer to r-pkgs textbook * indicate preferred folder for documenting extdata
1 parent e15cd72 commit c2aff3b

File tree

2 files changed

+25
-10
lines changed

2 files changed

+25
-10
lines changed

documentation.Rmd

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ it is always possible to extend existing classes.
2525

2626
A vignette demonstrates how to accomplish non-trivial tasks embodying the core
2727
functionality of your package. There are two common types of vignettes.
28-
28+
2929
* (Recommended) An *R markdown* vignette is similar to a *Sweave* vignette, but uses
3030
[markdown](http://daringfireball.net/projects/markdown/) instead of $\LaTeX$
3131
for structuring text sections and resulting in HTML output. The `r
@@ -39,7 +39,7 @@ functionality of your package. There are two common types of vignettes.
3939
class="fab fa-r-project"></i> code. The code chunk starts with a line
4040
`<<>>=`, and ends with `@`. Each chunk is evaluated during `R CMD build`,
4141
prior to $\LaTeX$ compilation to a PDF document.
42-
42+
4343
A vignette provides reproducibility: the vignette produces the same results as
4444
copying the corresponding commands into an <i class="fab fa-r-project"></i>
4545
session. It is therefore **essential** that the vignette embed executed <i
@@ -178,15 +178,29 @@ If this option is used it will also be preferable to use `donttest` instead of
178178
The scripts in this directory can vary.
179179

180180
Most importantly if data was included in the `inst/extdata/` directory, a
181-
related script must be present in this directory documenting very clearly how
182-
the data was generated and source information.
181+
related script must be present in this directory clearly documenting how the
182+
data was obtained and prepared.
183+
184+
It should include any source URLs and information regarding filtering or
185+
pre-processing.
186+
187+
It can be executable code, sudo code, or even a text description.
188+
189+
Users should be able to download and roughly reproduce the data file or object
190+
in `inst/extdata/`.
191+
192+
## The `data-raw` directory {#doc-data-raw}
183193

184-
It should include source URLs and any key information regarding filtering or processing.
194+
Although the preferred location is `inst/scripts`, the `data-raw` directory may
195+
be used instead to store scripts that generated data files or objects. Note
196+
that one potential disadvantage of using the `data-raw` directory is that the
197+
scripts are not included in the package installation folder (for users to
198+
inspect).
185199

186-
It can be executable code, sudo code, or a text description.
200+
For more details, see the `Data` chapter in Hadley Wickham's
201+
[R Packages][r-pkgs].
187202

188-
Users should be able to download and be able to roughly reproduce the file or
189-
object that is present as data.
203+
[r-pkgs]: https://r-pkgs.org/data.html
190204

191205
## Other {#other-doc}
192206

package-data.Rmd

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,9 @@ another package or the hubs as previously stated.
8383

8484
However, if this is not applicable, raw data files should be included in the
8585
`inst/extdata` directory. Files of these type are often accessed utilizing
86-
`system.file()`. _Bioconductor_ requires documentation on these files in an
87-
`inst/scripts/` directory. See [data documentation](#doc-inst-scripts).
86+
`system.file()`. _Bioconductor_ requires documentation of these files in either
87+
`inst/scripts/` (preferred) or `data-raw` directory. See
88+
[inst/scripts](#doc-inst-scripts) and [data-raw](#doc-data-raw) documentation.
8889

8990
### Internal data
9091

0 commit comments

Comments
 (0)