R/util.R

Defines functions check_pairwise check_df

check_df <- function(d){
  if(!inherits(d, "data.frame")){
    cli::cli_abort(c("{.var d} should be a dataframe or tibble."))
  }
}


check_pairwise <- function(d){
   if(!inherits(d, "pairwise")){
     if (!identical(names(d), names(pairwise(data.frame()))))
     cli::cli_abort(c("{.var d} should be of class pairwise."))
  }
}

Try the bullseye package in your browser

Any scripts or data that you put into this service are public.

bullseye documentation built on Sept. 11, 2024, 9:24 p.m.