powered by
Creates a type that checks for a specific vector length.
# S3 method for sicher_type [(type, size)
A new sicher_type that checks for the specified length
A sicher_type object
The required length (non-negative integer)
vec %:% Numeric[3] %<-% c(1, 2, 3) try(vec <- c(1, 2)) # Error: wrong length try(vec <- c("a", "b", "c")) # Error: wrong type
Run the code above in your browser using DataLab