NVIpackager
provides tools to facilitate development of NVIverse
packages. You should use ‘create_NVIpkg_skeleton’ to make a package
skeleton in accord with NVIverse standards. For further development and
maintenance there are tools for updating documentation and installing
development versions. The NVIpackager functions are to a large extent
wrappers for devtools and usethis functions. In addition, the templates
folder keeps templates for standard files like sections of README and
CONTRIBUTING.
NVIpackager
is part of NVIverse
, a collection of R-packages with
tools to facilitate data management and data reporting at the Norwegian
Veterinary Institute (NVI). The NVIverse
consists of the following
packages: NVIconfig
, NVIdb
, NVIpjsr
, NVIspatial
, NVIpretty
,
NVIbatch
, OKplan
, OKcheck
, NVIcheckmate
, NVIpackager
,
NVIrpackages
. See Contribute to
NVIpackager
for more information.
NVIpackager
is available at
GitHub. To install
NVIpackager
you will need:
- R version > 4.0.0
- R package
remotes
- Rtools version 4.0, 4.2 or 4.3 depending on R version
First install and attach the remotes
package.
install.packages("remotes")
library(remotes)
To install (or update) the NVIpackager
package without vignettes, run
the following code:
remotes::install_github("NorwegianVeterinaryInstitute/NVIpackager",
upgrade = FALSE,
build = TRUE,
build_vignettes = FALSE)
To install (or update) the NVIpackager
package with vignettes, you
will need to first install some additional R-packages needed for
creating the vignettes. Check README below in the section
Vignettes to see which vignettes are available. To install
the package with the vignettes, first install the packages: knitr
,
rmarkdown
, R.rsp
, and NVIrpackages
(from GitHub) if they are
missing. Then run the following code:
remotes::install_github("NorwegianVeterinaryInstitute/NVIpackager",
upgrade = FALSE,
build = TRUE,
build_vignettes = TRUE)
The NVIpackager
package needs to be attached.
library(NVIpackager)
NVIpackager
provides tools to facilitate development of NVIverse
packages. You should use ‘create_NVIpkg_skeleton’ to make a package
skeleton in accord with NVIverse standards. For further development and
maintenance there are tools for updating documentation and installing
development versions. The NVIpackager functions are to a large extent
wrappers for devtools and usethis functions. In addition, the templates
folder keeps templates for standard files like sections of README and
CONTRIBUTING.
To set up a package skeleton you can follow the following procedure:
-
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, BSD 3-clause
-
Create the repository.
-
Fork the repository to your own GitHub account.
-
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.
-
Create the package skeleton
NVIpackager::create_NVIpkg_skeleton(license_keyword = "BSD_3_clause")
-
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.
-
Update README and Mypackage-package help with the last changes in the DESCRIPTION file.
document_NVIpkg(pkg = stringi::stri_extract_last_words(usethis::proj_path()), pkg_path = usethis::proj_path(), style = FALSE, manual = "update", contributing = FALSE, readme = TRUE)
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.
The full list of all available functions and datasets can be accessed by typing
help(package = "NVIpackager")
Consult the vignettes for task-oriented help.
vignette(package = "NVIpackager")
Vignettes in package NVIpackager
:
- Contribute to NVIpackager (html)
- NVIpackager reference manual (pdf)
- NVIverse coding conventions (html)
Please check the NEWS for information on new features, bug fixes and other changes.
Copyright (c) 2021 - 2024 Norwegian Veterinary Institute.
Licensed under the BSD_3_clause License. See
License
for details.
Contributions to develop NVIpackager
is highly appreciated. 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.
See Contribute to
NVIpackager
for more information.
Please note that the NVIpackager project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.