prop_integer: Integer S7 property

View source: R/02_S7_prop_factories.R

prop_integerR Documentation

Integer S7 property

Description

Accepts R integers only (3L, not 3), so that a whole-number contract is enforced by the type rather than by a rounding check.

Usage

prop_integer(
  default = NULL,
  min = NULL,
  max = NULL,
  exclusive_min = NULL,
  exclusive_max = NULL,
  nullable = FALSE,
  vector = FALSE,
  min_items = 1L,
  unique_items = FALSE,
  description = ""
)

Arguments

default

Integer: Default value (NULL for none, or if nullable).

min, max

Integer or NULL: Inclusive bounds.

exclusive_min, exclusive_max

Integer or NULL: Exclusive bounds.

nullable

Logical: If TRUE, NULL is a valid value.

vector

Logical: If TRUE, the value is vector-valued (a JSON array).

min_items

Integer: Fewest elements a vector value may hold.

unique_items

Logical: If TRUE, a vector value's elements must be distinct.

description

Character: Human-readable description.

Value

S7 property.

Author(s)

EDG

Examples

n_iter <- prop_integer(default = 100L, min = 1L, description = "Iterations")

rtemis.core documentation built on Sept. 20, 2026, 9:06 a.m.