R: Require a Specific Version of a Package

requireversion {spatstat} | R Documentation

## Require a Specific Version of a Package

### Description

Checks that the version number of a specified package is greater than or equal to the specified version number. For use in stand-alone R scripts.

### Usage

    requireversion(pkg, ver, fatal=TRUE)

### Arguments

`pkg` | Package name.
`ver` | Character string containing version number.
`fatal` | Logical value indicating whether an error should occur when the package version is less than `ver`.

### Details

This function checks whether the installed version of the package `pkg` is greater than or equal to `ver`. By default, an error occurs if this condition is not met.

It is useful in stand-alone R scripts, which often require a particular version of a package in order to work correctly.

This function should not be used inside a package: for that purpose, the dependence on packages and versions should be specified in the package description file.

### Value

A logical value.

### Author(s)

Adrian Baddeley Adrian.Baddeley@curtin.edu.au

### Examples

      requireversion(spatstat, "1.42-0")
      requireversion(spatstat, "999.999-999", fatal=FALSE)

[Package spatstat version 1.63-3 Index]