install_NVIpkg: Install an NVIverse Package during the Development Phase

View source: R/install_NVIpkg.R

install_NVIpkgR Documentation

Install an NVIverse Package during the Development Phase

Description

Installation of an NVIverse package from github or from local directory. Mainly intended for installation of a package during development to test new code in the package scripts .

Usage

install_NVIpkg(
  pkg = stringi::stri_extract_last_words(usethis::proj_path()),
  pkg_path = usethis::proj_path(),
  lib = R.home(),
  rsource,
  username = "NorwegianVeterinaryInstitute",
  ...
)

Arguments

pkg

[character(1)]
The package name. Defaults to stringi::stri_extract_last_words(usethis::proj_path()).

pkg_path

[character(1)]
The path to the package directory. Defaults to usethis::proj_path().

lib

[character(1)]
The library directory where to install. Defaults to R.home().

rsource

[character(1)]
Source of package. Must be one of c("github", "local").

username

[character(1)]
The github username where the repository is found. Defaults to "NorwegianVeterinaryInstitute".

...

Other arguments to be passed to remotes::install_github, or devtools::install.

Details

When rsource = "github", the default is to install the latest version in the main branch at the NorwegianVeterinaryInstitute package repository. During package development one will usually change the username to your own.

The repository can be changed by giving more arguments that will be passed to install_github, see install_github, for full description of the arguments repo, username, and ref.

When rsource = "local", it installs the package from a local copy of the package repository. It defaults to install the active branch. Use rsource = "local" to test new code during development.

For installing the latest released versions of NVIverse packages, use install_github, or NVIbatch::use_NVIverse.

Value

None. Installs a package.

Author(s)

Petter Hopp Petter.Hopp@vetinst.no

Examples

## Not run: 
# Installs a package from local PC
# You need to be in a package directory at you PC for the code to work.
pkg <- stringi::stri_extract_last_words(usethis::proj_path())
pkg_path = usethis::proj_path()

NVIpackager::install_NVIpkg(pkg = pkg, pkg_path = pkg_path, rsource = "local")

## End(Not run)


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