Helper Package to Install Packages for R

Helper function to install packages for R using an external 'requirements.txt' or a string containing diverse packages from several resources like Github or CRAN.


requiRements

codecov CRAN Status Badge CRAN Checks

The R package requiRements provides the ability to install all packages provided in a text or given a raw string. This is meant to simply keep all e.g project dependent packages in one file (like the demo requirements.txt within ./data-raw/requirements.txt) and install them all in a rush by using requiRements::install("./requirements.txt").

This is well known from python and now available within R.

Installation

You can install requiRements directly from CRAN:

install.packages("requiRements")

The development version can be installed using

install.packages("devtools")
devtools::install_github("joundso/requirements", ref = "development")

Basic functions

Install some packages providing a single string

## Test it with a string:
demo_string <- "
DIZtools
data.table
joundso/mainzelliste-connector
miracum/misc-diztools@dev
# this_one_will_be_ignored
"
requiRements::install(packages = demo_string)

Install some packages providing a string vector

## Test it with a vector:
demo_vec <-
  c(
    "",
    "DIZtools",
    "data.table",
    "joundso/mainzelliste-connector",
    "miracum/misc-diztools@dev",
    "# this_one_will_be_ignored"
  )
requiRements::install(packages = demo_vec)

Install some packages providing a file containing the packagenames

## Test it with a file:
demo_path <- "./data-raw/requirements.txt"
requiRements::install(path_to_requirements = demo_path)

Install some packages with a string AND a file

:bulb: Using the above defined variables demo_string, demo_vec and demo_path:

## Test it with a string AND a file:
requiRements::install(packages = demo_string,
                      path_to_requirements = demo_path)

## Test it with a vector AND a file:
requiRements::install(packages = demo_vec,
                      path_to_requirements = demo_path)

Supported syntax

Platform Syntax Example
CRAN packagename requiRements::install(packages = "data.table")
GitHub user/repo-name requiRements::install(packages = "joundso/mainzelliste-connector")
GitHub with Branch/Reference user/repo-name@ref requiRements::install(packages = "miracum/misc-diztools@dev")

:bulb: You can improve this package

  • Missing some functionalities?
  • Found a Bug?

--> Feel free to create an issue or (even better) a pull request. :pray: Thanks in advance!

More Infos

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("requiRements")

0.0.3 by Jonathan M. Mang, 4 years ago


https://github.com/joundso/requirements


Report a bug at https://github.com/joundso/requirements/issues


Browse source code at https://github.com/cran/requiRements


Authors: Jonathan M. Mang [aut, cre] , MIRACUM - Medical Informatics in Research and Care in University Medicine [fnd] , Universitätsklinikum Erlangen [cph]


Documentation:   PDF Manual  


GPL-3 license


Imports remotes

Suggests lintr, testthat


See at CRAN