R/helpers.R

Defines functions .pattern_python_to_r .check_system

.check_system <- function(package) {
  out <- suppressWarnings(system(glue::glue("which {package}"), intern = TRUE))

  if (length(out) == 0) {
    stop("Pacakge ", package," not installed.")
  }
}


.pattern_python_to_r <- function(x) {
  x <- gsub("%(", "{", x, fixed = TRUE)
  x <- gsub(")s", "}", x, fixed = TRUE)
  x
}
eliocamp/cimadata documentation built on Nov. 20, 2023, 5:45 a.m.