R/utils.R

Defines functions read_pct

# define global variables
utils::globalVariables(c("pct_regions_lookup"))

read_pct = function(u_file, fun) {
  u_ok = crul::ok(u_file)
  if(!u_ok) {
    message("Could not find anything at this URL:\n", u_file)
    message("Check the region exists and internet connection")
  } else {
    fun(u_file)
  }
}

Try the pct package in your browser

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

pct documentation built on May 31, 2023, 7:55 p.m.