powered by
Check vector/matrix/data.frame for expected dimensions or throw error
check_dims(x, d, par)
nothing if no error, otherwise throws error
object to check
expected dimensions
character name of x (for error message)
y <- c(1,3,4) check_dims(y, 3, "y")
Run the code above in your browser using DataLab