Learn R Programming

sicher (version 0.1.0)

Scalar: Create a scalar (length-1) type variant

Description

Creates a type that only accepts single values (vectors of length 1).

Usage

Scalar(type)

Value

A new sicher_type that checks for length 1

Arguments

type

A sicher_type object

Examples

Run this code
age %:% Scalar(Integer) %<-% 30L
try(age <- c(30L, 40L))  # Error: not scalar

Run the code above in your browser using DataLab