-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.Rmd
116 lines (96 loc) · 4.06 KB
/
README.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
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
---
title: "README"
output:
md_document:
variant: markdown_github
params:
NVIpkg: "NVIpackager"
pkg_path: !r usethis::proj_path()
first_copyright_year: "2021"
---
```{r, include = FALSE}
NVIpkg <- params$NVIpkg
pkg_path <- params$pkg_path
# NVIpkg <- stringi::stri_extract_last_words(usethis::proj_path())
NVIpkg_inline <- paste0("`", NVIpkg, "`")
logo_path <- ""
if (file.exists(paste0("./man/figures/", NVIpkg, "_logo.png"))) {
logo_path <- paste0(' <img src="man/figures/', NVIpkg, '_logo.png" align="right" height="138" />')
}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```
`r paste0(NVIpkg, ": ", desc::desc_get_field(key = "Title"), logo_path)`
================
<!-- README.md is generated from README.Rmd. Please edit that file -->
- [Overview](#overview)
- [Installation](#installation)
- [Usage](#usage)
- [Copyright and license](#copyright-and-license)
- [Contributing](#contributing)
## Overview
```{r, include = FALSE}
description <- desc::desc_get_field(key = "Description")
```
`r paste0(NVIpkg_inline,
"",
sub(substr(description,1,1), tolower(substr(description,1,1)), description))`
```{r child=system.file('templates', "README_NVIverse.Rmd", package = "NVIpackager")}
```
## Installation
```{r child=system.file('templates', "README_installation.Rmd", package = "NVIpackager")}
```
## Usage
```{r child=system.file('templates', "README_usage_attach.Rmd", package = "NVIpackager")}
```
`r paste0(NVIpkg_inline,
"",
sub(substr(description,1,1), tolower(substr(description,1,1)), description))`
#### Create a NVIverse package skeleton
To set up a package skeleton you can use the following procedure:
1. Create a repository for the package at the NorwegianVeterinaryInstitute's GitHub account. Give the repository the name of the package.
- Make a short descriptive text. This can later be used as the Title in the DESCRIPTION file.
- Choose between Public or Private. If unsure, start with Private. It is easy to change to Public later.
- Mark for Add a README file.
- Choose the .gitignore template for R.
- Choose a licence, For example MIT or BSD 3-clause
2. Create the repository.
3. Fork the repository to your own GitHub account.
4. Create an R-studio project for the package. In R-studio
- Choose New project -> Version control
- Copy the directory at GitHub and paste it where asked in R-studio.
- Select a directory in your PC for your package.
5. Create the package skeleton
``` {r, eval = FALSE}
NVIpackager::create_NVIpkg_skeleton(license_keyword = "BSD_3_clause")
```
6. Modify the DESCRIPTION file
- Copy the descriptive text into the Title field in the DESCRIPTION file.
- Copy the descriptive text into the Description field in the DESCRIPTION file and eventually extend it.
7. Update README and Mypackage-package help with the last changes in the DESCRIPTION file.
``` {r update_readme_text, message=FALSE, warnings=FALSE, echo=FALSE, prompt = FALSE, comment = ""}
update_readme_text <- paste('document_NVIpkg(pkg = stringi::stri_extract_last_words(usethis::proj_path()),',
' pkg_path = usethis::proj_path(),',
' style = FALSE,',
' manual = "update",',
' contributing = FALSE,',
' readme = TRUE)',
sep = '\n')
cat(update_readme_text, sep = "", fill = TRUE)
```
#### Maintenance of a NVIverse package
Functions for updating documentation, performing tests, build and install the package are collected in the file "./notes/develop.R". You can run the different sections stepwise during package maintenance and updating.
```{r child=system.file('templates', "README_usage_help.Rmd", package = "NVIpackager")}
```
## Copyright and license
```{r child=system.file('templates', "README_copyright_and_license.Rmd", package = "NVIpackager")}
```
## Contributing
```{r child=system.file('templates', "README_contributing.Rmd", package = "NVIpackager")}
```
<!-- Code of conduct -->
-----
```{r child=system.file('templates', "README_code_of_conduct.Rmd", package = "NVIpackager")}
```