check_dim | R Documentation |
Checks dimension of an object.
check_dim(x, dim = length, values = numeric(0), x_name = NULL, dim_name = NULL)
x |
The object to check. |
dim |
A function returning a non-negative whole number of the dimension. |
values |
A flag or a whole numeric vector of the value, value range or possible values. |
x_name |
A string of the name of object x or NULL. |
dim_name |
A string of the name of the dim function. |
An informative error if the test fails or an invisible copy of x.
Other check:
check_data()
,
check_dirs()
,
check_files()
,
check_key()
,
check_names()
,
check_values()
check_dim(1)
try(check_dim(1, values = FALSE))
try(check_dim(1, values = c(10, 2)))
try(check_dim(data.frame(x = 1), dim = nrow, values = c(10, 10, 2)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.