Skip to content

Commit

Permalink
Merge pull request #10 from PetterHopp/main
Browse files Browse the repository at this point in the history
OKplan v0.5.0
  • Loading branch information
PetterHopp authored Dec 15, 2022
2 parents d6bd2ae + f56e8db commit 8adb0af
Show file tree
Hide file tree
Showing 24 changed files with 986 additions and 298 deletions.
64 changes: 37 additions & 27 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,36 +37,41 @@ data reporting at the Norwegian Veterinary Institute (NVI).
<td style="text-align: left;">Tools to facilitate the use of NVI’s databases</td>
</tr>
<tr class="odd">
<td style="text-align: left;">NVIspatial</td>
<td style="text-align: left;">Public</td>
<td style="text-align: left;">Tools to facilitate working with spatial data at NVI</td>
</tr>
<tr class="even">
<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">
<tr class="odd">
<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">
<tr class="even">
<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">
<tr class="odd">
<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">
<tr class="even">
<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">
<tr class="odd">
<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>
<tr class="odd">
<tr class="even">
<td style="text-align: left;">NVIrpackages</td>
<td style="text-align: left;">Public</td>
<td style="text-align: left;">Keeps a table of the R-Packages in NVIverse</td>
Expand Down Expand Up @@ -150,38 +155,43 @@ adhere to some principles and style convention used for
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.
guide](http://style.tidyverse.org) with some modifications.

- use snake\_case for variable names, column names, function names
etc.
- function names should start with a verb and should be
descriptive and can be long. Avoid strange abbreviations.
- to indent the code you may use the short cut keys Ctrl+a (select
all) and Ctrl+i (indent) when you are in R-studio.
- I recommend to use the
[`styler`](https://CRAN.R-project.org/package=styler) package to
apply spaces:
`styler::style_file(filename, scope = c("spaces", "line_breaks"))`.
Please don’t restyle code that has nothing to do with your pull
request.

- You should add a bullet point to `NEWS` 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.
Although not expected from all contributors, it will be highly
appreciated if you also are willing to suggest:

- `NVIverse`-packages use the assert-functions from
- documentation for new functions or new arguments to existing
functions The `NVIverse`-packages use
[`roxygen2`](https://cran.r-project.org/package=roxygen2) for
documentation.

- argument checking of the function arguments. The `NVIverse`-packages
use the assert-functions from the
[`checkmate`](https://CRAN.R-project.org/package=checkmate) package
for argument checking as well as some additional assert\_functions
in
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
- one or more tests ensuring that the function works as intended. The
`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
Expand Down
17 changes: 11 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: OKplan
Title: Tools to facilitate the Planning of the annual Surveillance Programmes
Version: 0.4.2
Date: 2022-01-20
Version: 0.5.0
Date: 2022-12-15
Authors@R:
c(person(given = "Petter",
family = "Hopp",
Expand All @@ -24,11 +24,14 @@ Imports:
knitr,
magrittr,
openxlsx,
rlang,
rmarkdown,
stats,
NVIbatch (>= 0.4.0),
NVIdb (>= 0.3.0),
NVIpretty,
NVIrpackages
NVIpretty (>= 0.4.0),
NVIrpackages,
OKcheck
Suggests:
covr,
devtools,
Expand All @@ -37,10 +40,12 @@ Suggests:
utils,
NVIpackager
Remotes:
NorwegianVeterinaryInstitute/NVIbatch,
NorwegianVeterinaryInstitute/NVIdb,
NorwegianVeterinaryInstitute/NVIpretty,
NorwegianVeterinaryInstitute/NVIpackager,
NorwegianVeterinaryInstitute/NVIrpackages
RoxygenNote: 7.1.2
NorwegianVeterinaryInstitute/NVIrpackages,
NorwegianVeterinaryInstitute/OKcheck
RoxygenNote: 7.2.3
VignetteBuilder: knitr
Language: en-GB
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ export(adjust_samples_to_budget)
export(append_date_generated_line)
export(append_sum_line)
export(check_OK_selection)
export(check_ok_selection)
export(make_random)
export(style_sum_line)
export(write_ok_selection_list)
importFrom(magrittr,"%>%")
importFrom(rlang,.data)
21 changes: 21 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
OKplan 0.5.0 - (2022-12-15)
---------------------------

New features:

- write_ok_selection_list now includes the argument `add_worksheet` that makes it possible to add a new worksheet to an existing workbook.

- adjust_samples_to_budget includes the argument `group` so that sample size can be adjusted per group.

- check_ok_selection now calls an R markdown file, generates a html-report with descriptive statistics and displays the report in the browser. The function is renamed (all lower case letters) and includes several new arguments. check_OK_selection is deprecated.

Other changes:

- README updated with improved installation guide.


BREAKING CHANGES:

- Renamed to check_ok_selection from check_OK_selection. check_OK_selection is deprecated.


OKplan 0.4.2 - (2022-01-20)
---------------------------

Expand Down
22 changes: 22 additions & 0 deletions R/OKplan-deprecated.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#' @title Deprecated Functions in Package OKplan
#' @description These functions are provided for compatibility with older
#' versions of OKplan only, and may be defunct as soon as the next release.
#' When possible, alternative functions are mentioned. Help pages for
#' deprecated functions are available at \code{help("<function>-deprecated")}.
#' @details \code{check_OK_selection} was deprecated 2022-12-15 to replace it
#' with check_ok_selection with a standardised function name with lower case
#' letters for OK. Use check_ok_selection with the additional parameters
#' \code{purpose =} and \code{plan_aar =}.
#'
#' @param \dots (arguments)
#' @return (results)
#' @name OKplan-deprecated
#' @keywords internal
#'
#' @author Petter Hopp Petter.Hopp@@vetinst.no
#'
#' @examples
#' \dontrun{
#' check_OK_selection(...) ### -- use \code{\link{check_ok_selection}} instead.
#' }
NULL
Loading

0 comments on commit 8adb0af

Please sign in to comment.