Skip to content

Commit

Permalink
Merge pull request #4 from PetterHopp/main
Browse files Browse the repository at this point in the history
OKplan v0.3.0
  • Loading branch information
PetterHopp authored Nov 29, 2021
2 parents 4cf6839 + cf0365c commit 397c1dd
Show file tree
Hide file tree
Showing 28 changed files with 1,169 additions and 246 deletions.
4 changes: 3 additions & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
^build.R
^install.R
^style.R
^README.md
^README\.md
^README\.Rmd
^doc$
^Meta$
^OKplan.Rcheck\vign_test$
^CONTRIBUTING\.md
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
.Ruserdata
*.Rproj
*.Rcheck
inst/doc
214 changes: 214 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
# Contribute to OKplan

<!-- CONTRIBUTING.md and ./vignettes/Contribute_to_NVIpkg.Rmd. are generated
from ./templates/Contribute_to_NVIpkg.Rmd in NVIpackager.
Please edit that file -->

Thank you for considering contributing to `OKplan`.

`OKplan` is one of several packages assembled under the name `NVIverse`,
a collection of R-packages with tools to facilitate data management and
data reporting at the Norwegian Veterinary Institute (NVI).

### NVIverse packages

<table>
<colgroup>
<col style="width: 13%" />
<col style="width: 8%" />
<col style="width: 78%" />
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">Package</th>
<th style="text-align: left;">Status</th>
<th style="text-align: left;">Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">NVIconfig</td>
<td style="text-align: left;">Private</td>
<td style="text-align: left;">Configuration information necessary for some NVIverse functions</td>
</tr>
<tr class="even">
<td style="text-align: left;">NVIdb</td>
<td style="text-align: left;">Public</td>
<td style="text-align: left;">Tools to facilitate the use of NVI’s databases</td>
</tr>
<tr class="odd">
<td style="text-align: left;">NVIpretty</td>
<td style="text-align: left;">Public</td>
<td style="text-align: left;">Tools to make R-output pretty in accord with NVI’s graphical profile</td>
</tr>
<tr class="even">
<td style="text-align: left;">NVIbatch</td>
<td style="text-align: left;">Public</td>
<td style="text-align: left;">Tools to facilitate the running of R-scripts in batch mode at NVI</td>
</tr>
<tr class="odd">
<td style="text-align: left;">OKplan</td>
<td style="text-align: left;">Public</td>
<td style="text-align: left;">Tools to facilitate the planning of surveillance programmes for the NFSA</td>
</tr>
<tr class="even">
<td style="text-align: left;">OKcheck</td>
<td style="text-align: left;">Public</td>
<td style="text-align: left;">Tools to facilitate checking of data from national surveillance programmes</td>
</tr>
<tr class="odd">
<td style="text-align: left;">NVIcheckmate</td>
<td style="text-align: left;">Public</td>
<td style="text-align: left;">Extension of checkmate with argument checking adapted for NVIverse</td>
</tr>
<tr class="even">
<td style="text-align: left;">NVIpackager</td>
<td style="text-align: left;">Public</td>
<td style="text-align: left;">Tools to facilitate the development of NVIverse packages</td>
</tr>
</tbody>
</table>

How you can contribute
----------------------

There are several ways you can contribute to this project: ask a
question, propose an idea, report a bug, improve the documentation, or
contribute code.

### Ask a question

Using `OKplan` and need help? Browse the package help to see if you can
find a solution. Still problems? Post your question in R-forum at
workplace or contact the package maintainer by
[email](mailto:[email protected]).

### Propose an idea

Have an idea for a new `OKplan` feature? Take a look at the `OKplan`
help and [issue
list](https://github.com/NorwegianVeterinaryInstitute/OKplan/issues) to
see if it isn’t included or suggested yet. If not, suggest your idea as
an [issue on
GitHub](https://github.com/NorwegianVeterinaryInstitute/OKplan/issues/new).
While we can’t promise to implement your idea, it helps to:

- Explain in detail how it would work.
- Keep the scope as narrow as possible.

See below if you want to contribute code for your idea as well.

### Report a bug

Using `OKplan` and discovered a bug? Don’t let others have the same
experience and report it as an [issue on
GitHub](https://github.com/NorwegianVeterinaryInstitute/OKplan/issues/new)
so we can fix it. A good bug report makes it easier for us to do so, so
please include:

- Any details about your local setup that might be helpful in
troubleshooting.
- Detailed steps to reproduce the bug.

### Improve the documentation

Noticed a typo on the function help? Think a function could use a better
example? Good documentation makes all the difference, so your help to
improve it is very welcome!

Functions are described as comments near their code and translated to
documentation using [`roxygen2`](https://klutometis.github.io/roxygen/).
If you want to improve a function description:

1. Go to `R/` directory in the [code
repository](https://github.com/NorwegianVeterinaryInstitute/OKplan/tree/main/R).
2. Look for the file with the name of the function.
3. [Propose a file
change](https://help.github.com/articles/editing-files-in-another-user-s-repository/)
to update the function documentation in the roxygen comments
(starting with `#'`).

### Contribute code

Care to fix bugs or implement new functionality for our\_package? Great!
Have a look at the [issue
list](https://github.com/NorwegianVeterinaryInstitute/OKplan/issues) and
leave a comment on the things you want to work on. See also the
development guidelines below.

Development guidelines
----------------------

If you want to contribute code, you are welcome to do so. Please try to
adhere to some principles and style convention used for
`NVIverse`-packages.

- Please limit the number of package dependencies for `OKplan`. The
use of base functions is much appreciated.

- New code should generally follow the tidyverse [style
guide](http://style.tidyverse.org). I recommend to use the
[`styler`](https://CRAN.R-project.org/package=styler) package to
apply spaces: `styler::style_file(filename, scope = "spaces")`.
Please don’t restyle code that has nothing to do with your pull
request.

- You should add a bullet point to `NEWS.md` motivating the change.

- You should add yourself as a contributor to the `DESCRIPTION`.

- If you’re adding a new function or new arguments to an existing
function, you’ll also need to document them. `NVIverse`-packages use
[`roxygen2`](https://cran.r-project.org/package=roxygen2), with
[Markdown
syntax](https://cran.r-project.org/web/packages/roxygen2/vignettes/markdown.html),
for documentation. Make sure to re-run `devtools::document()` on the
code before submitting.

- `NVIverse`-packages use the assert-functions from
[`checkmate`](https://CRAN.R-project.org/package=checkmate) package
for argument checking as well as some additional assert\_functions
in
[`NVIcheckmate`](https://github.com/NorwegianVeterinaryInstitute/NVIcheckmate).
Adding argument checking for new functions and/or arguments will be
highly appreciated.

- If you can, also write a test. `NVIverse`-packages use
[`testthat`](https://cran.r-project.org/package=testthat) for tests.

- Also run `devtools::check()` to make sure your function doesn’t
imply downstream errors or warnings.

### Git commit standards

We follow the commit message style guide maintained within the
angular.js project.

The start of commit messages should be one of the following:

- feat: A new feature
- fix: A bug fix
- doc: Documentation only changes
- style: Changes that do not affect the meaning of the code
(white-space, formatting, missing semi-colons, etc)
- refactor: A code change that neither fixes a bug or adds a feature
- perf: A code change that improves performance
- test: Adding missing tests
- chore: Changes to the build process or auxiliary tools and libraries
such as documentation generation

Do not capitalize the first letter.

Code of conduct
---------------

Please note that this project is released with a [Contributor Code of
Conduct](https://contributor-covenant.org/version/2/0/CODE_OF_CONDUCT.html).
By participating to this project, you agree to abide by its terms.

References
----------

This document is adapted from a
[template](https://gist.github.com/peterdesmet/e90a1b0dc17af6c12daf6e8b2f044e7c)
by @peterdesmet .
51 changes: 29 additions & 22 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,35 +1,42 @@
Package: OKplan
Title: Tools facilitating the planning of surveillance programmes for the NFSA
Version: 0.2.0
Date: 2021-01-29
Author: Petter Hopp <[email protected]>
Maintainer: Petter Hopp <[email protected]>
Description: The R-package include tools facilitating the planning of surveillance programmes
for the Norwegian Food Safety Authority. The package is under development. Included will
be tools for:
1) Making the target population,
2) Random selection,
3) generate lists for the NFSA.
Title: Tools to facilitate the Planning of the annual Surveillance Programmes
Version: 0.3.0
Date: 2021-11-29
Authors@R:
c(person(given = "Petter",
family = "Hopp",
role = c("aut", "cre"),
email = "[email protected]"),
person(given = "Norwegian Veterinary Institute",
role = "cph"))
Description: Provide tools to facilitate the planning of the annual surveillance
programmes. The main focus is tools for generating standardized lists for
NFSA.
URL: https://github.com/NorwegianVeterinaryInstitute/OKplan
BugReports: https://github.com/NorwegianVeterinaryInstitute/OKplan/issues
Depends: R (>= 3.4.1)
License: Proprietary. Do not distribute outside the Norwegian Veterinary Institute
Depends: R (>= 3.5.0)
License: BSD_3_clause + file LICENSE
Encoding: UTF-8
LazyData: true
Imports:
checkmate,
poorman,
NVIdb,
checkmate
RoxygenNote: 7.1.1
stats,
NVIdb (>= 0.3.0)
Suggests:
usethis,
covr,
devtools,
knitr,
remotes,
testthat,
rmarkdown,
roxygen2,
withr,
devtools,
styler,
knitr,
rmarkdown
testthat,
usethis,
NVIpackager
Remotes:
NorwegianVeterinaryInstitute/NVIdb,
NorwegianVeterinaryInstitute/NVIpackager
RoxygenNote: 7.1.1
VignetteBuilder: knitr
Language: en-GB
6 changes: 4 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Generated by roxygen2: do not edit by hand

export(control_OK_selection)
export(include_generated_date)
export(adjust_samples_to_budget)
export(append_date_generated_line)
export(append_sum_line)
export(check_OK_selection)
export(make_random)
33 changes: 30 additions & 3 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,21 +1,48 @@
OKplan 0.3.0 - (2021-11-29)
---------------------------

New features:

- adjust_sample_number adjusts the sample numbers per unit up or down to reach the total sample size in accord with the budget.

- append_sum_line appends a line with the sum of samples to the table in Excel.


Bug fixes:

- Included reference to NVIdb at GitHub to correct potential problems when installing the package.


Other changes:

- Updated licence to BSD_3_clause and the copyright holder to Norwegian Veterinary Institute.

- Updated documentation and help.


BREAKING CHANGES:

- Renamed to append_date_generated_line from include_generated_date.


OKplan 0.2.0 - (2021-01-29)
--------------------------
---------------------------

New features:

- Included a preliminary version of control_OK_selection for control of standard files with OK selection data.


OKplan 0.1.1 - (2021-01-01)
--------------------------
---------------------------

Other changes:

- included argument checking based on checkmate


OKplan 0.1.0 - (2020-12-30)
--------------------------
---------------------------

First release:

Expand Down
Loading

0 comments on commit 397c1dd

Please sign in to comment.