tests/testthat/helper-numbers.R

# Formatted numbers back to numbers (minus signs, padding, leading zeros)
as_num <- function(x) {
  x <- gsub(intToUtf8(8722), "-", x, fixed = TRUE)
  x <- gsub("[^0-9.-]", "", x)
  as.numeric(x)
}

ci_bounds <- function(x) {
  x <- gsub(intToUtf8(8722), "-", x, fixed = TRUE)
  parts <- strsplit(gsub("[^0-9.,-]", "", x), ",", fixed = TRUE)
  t(vapply(parts, as.numeric, numeric(2)))
}

Try the apa7 package in your browser

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

apa7 documentation built on Dec. 1, 2026, 5:06 p.m.