R/helper_functions_for_p0.R

Defines functions is_scalar is_global_variable is_numeric_string

is_numeric_string <- function(x) {
  grepl("^-?\\d*(\\.\\d+)?$", x)
}

is_global_variable <- function(var_name) {
  exists(var_name, envir = .GlobalEnv)
}

is_scalar <- function(x) {
  is.atomic(x) && length(x) == 1
}

Try the twig package in your browser

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

twig documentation built on April 12, 2025, 2:08 a.m.