R/zzz.R

Defines functions safe_match_default safe_match_3_0 .onLoad

# nocov start
.onLoad <- function(libname, pkgname) {
  if (getRversion() == "3.3.0") {
    safe_match <<- safe_match_3_0
  } else {
    safe_match <<- safe_match_default
  }

  num <<- pillar::num
  set_num_opts <<- pillar::set_num_opts
  char <<- pillar::char
  set_char_opts <<- pillar::set_char_opts
}

safe_match_3_0 <- function(x, table) {
  match(x, table, incomparables = character())
}

safe_match_default <- function(x, table) {
  match(x, table)
}
# nocov end
tidyverse/tibble documentation built on April 21, 2024, 12:32 p.m.