forked from hadley/r-pkgs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
misc.rmd
80 lines (56 loc) · 3.21 KB
/
misc.rmd
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
---
layout: default
title: Other components
output: bookdown::html_chapter
---
# Other components
* `.Rbuildignore`
* `inst/`
* `exec/`: executable scripts
* `po/`: translation files
* the `inst/CITATION` file describes how to cite your package. If you have
published a peer reviewed article which you'd like people to cite when they
use your software, this is the place to put it.
* the `demo/` directory contains larger scale demos, that use many
features of the package.
## `CITATION`
The `CITATION` file lives in the `inst` directory and is intimately connected to the `citation()` function which tells you how to cite R and R packages. Calling `citation()` without any arguments tells you how to cite base R:
To cite R in publications use:
R Core Team (2012). R: A language and environment for statistical
computing. R Foundation for Statistical Computing, Vienna, Austria.
ISBN 3-900051-07-0, URL http://www.R-project.org/.
A BibTeX entry for LaTeX users is
@Manual{,
title = {R: A Language and Environment for Statistical Computing},
author = {{R Core Team}},
organization = {R Foundation for Statistical Computing},
address = {Vienna, Austria},
year = {2012},
note = { {ISBN} 3-900051-07-0},
url = {http://www.R-project.org/},
}
We have invested a lot of time and effort in creating R, please cite it
when using it for data analysis. See also ‘citation("pkgname")’ for
citing R packages.
This is generated from a `CITATION` file that looks like this:
bibentry("Manual",
title = "R: A Language and Environment for Statistical Computing",
author = person("R Core Team"),
organization = "R Foundation for Statistical Computing",
address = "Vienna, Austria",
year = version$year,
note = "{ISBN} 3-900051-07-0",
url = "http://www.R-project.org/",
mheader = "To cite R in publications use:",
mfooter =
paste("We have invested a lot of time and effort in creating R,",
"please cite it when using it for data analysis.",
"See also", sQuote("citation(\"pkgname\")"),
"for citing R packages.", sep = " ")
)
As you can see, it's pretty simple: you only need to learn one new function, `bibentry()`. The most important arguments, are `bibtype` (the first argument, which can "Article", "Book", "PhDThesis" and so on), and then the standard bibliographic information like `title,`, `author`, `year`, `publisher`, `journal`, `volume`, `issue`, `pages` and so on (they are all described in detail in `?bibEntry`). The header (`mheader`) and footer (`mfooter`) are optional, and are useful places for additional exhortations.
## Demos
A demo is very much like a function example, but is longer, and shows how to use multiple functions together. Demos are `.R` files that live in the `demo/` package directory, and are accessed with the `demo()` function.
(NOT YET IMPLEMENTED) The `demos` directory also needs an index. The easiest way to generate that index is to add a roxygen comment with `@demoTitle` tag:
#' @demoTitle my title
The roxygen process that turns this comment into an index is described in the next chapter.