Skip to contents

Asserts that an object is pkgsnip::param_lbl(id = "df_or_tibble", as_sentence = FALSE).

Usage

assert_df_or_tibble(x, name = "x")

Arguments

x

R object to test.

name

Name of the checked object to print in error message in case the assertion fails. A character scalar.

Value

x, invisibly.

See also

Other functions extending the checkmate package: assert_class_any(), assert_cli(), assert_inf_count(), assert_mime_type()

Examples

tibble::tibble() |> pal::assert_df_or_tibble()

try(
  matrix() |> pal::assert_df_or_tibble()
)
#> Error in assert_class_any(x = x, classes = c("data.frame", "tbl", "tbl_dbi",  : 
#>   `x` must be member of any of the classes "data.frame", "tbl", "tbl_dbi", "tbl_df", "tbl_lazy" or "tbl_sql", but is of classes "matrix" and "array".