R/util_general.R

Defines functions url_encode warn_experimental replace_nas

replace_nas = function(cur, rep) {
  cur[is.na(cur)] = rep[is.na(cur)]
  cur
}

warn_experimental = function(call = rlang::caller_call()) {
  fn = rlang::call_name(call)
  id = if (is.null(fn)) "unknown" else fn

  cli::cli_warn(
    c( "i" = paste0(
      "The function {.fun {id}} is currently ",
      "considered experimental. Its interface, implementation, and other ",
      "features may change significantly in future versions of the package. ",
      "Use with caution."
    ) ),
    .frequency = "once", .frequency_id = paste0("warn_experimental_", id)
  )
}

url_encode = function(urls) {
  purrr::map_chr(urls, utils::URLencode)
}

Try the ghclass package in your browser

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

ghclass documentation built on Aug. 31, 2026, 5:08 p.m.