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)

Overview

description <- desc::desc_get_field(key = "Description")

r paste0(NVIpkg_inline, "", sub(substr(description,1,1), tolower(substr(description,1,1)), description))


Installation


Usage


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.


Copyright and license


Contributing






PetterHopp/NVIpackager documentation built on Sept. 14, 2024, 1:24 a.m.