assert_df_or_tibble: Assert object is data frame or tibble (extension)

assert_df_or_tibbleR Documentation

Assert object is data frame or tibble (extension)

Description

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()

Examples

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

try(
  matrix() |> pal::assert_df_or_tibble()
)

salim-b/pal documentation built on Feb. 28, 2025, 6:51 p.m.