check.1.integer {spatstat.utils}R Documentation

Check Argument Type and Length

Description

These utility functions check whether a given argument is a single value of the required type.

Usage

check.1.real(x, context = "", fatal = TRUE)
check.1.integer(x, context = "", fatal = TRUE)
check.1.string(x, context = "", fatal = TRUE)

Arguments

x

The argument to be checked.

context

Optional string specifying the context in which the argument is checked.

fatal

Logical value indicating what to do if x is not of the required type.

Details

These functions check whether the argument x is a single atomic value of type numeric, integer or character.

If x does have the required length and type, the result of the function is the logical value TRUE.

If x does not have the required length and type, then if fatal=TRUE (the default) an error occurs, while if fatal=FALSE a warning is issued and the function returns the value FALSE.

Value

A logical value (or an error may occur).

Author(s)

Adrian Baddeley Adrian.Baddeley@curtin.edu.au.

See Also

check.named.vector

Examples

  x <- pi
  check.1.real(x)
  check.1.integer(x, fatal=FALSE)
  check.1.string(x, fatal=FALSE)

[Package spatstat.utils version 1.13-0 Index]