stop_length_message: Check dimension requirement

Description Usage Arguments Value Examples

View source: R/main.R

Description

Stops code if dimension of x is not as specified by y.

Usage

1

Arguments

x

vector that should be length y, or an array that should have dimensions specified by y.

y

numeric scalar indicating required length of x, or vector of scalars indicating required dimensions of x.

Value

Error message if x does not have dimensions specified by y, otherwise, nothing is returned.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Returns error (not run)
#x <- c(1,2,3)
#y <- 4
#stop_length_message(x,y)


##Returns error (not run)
#x <- matrix(1:4,2,2)
#y <- c(1,2)
#stop_length_message(x,y)

tpgarcia/stride documentation built on March 18, 2021, 3:42 p.m.