tests/testthat/helper-return-cleaners.R

# This fn removes calls from function returns to make testing easier
rmcall <- function(obj) {
  if (!is.null(obj[["call"]])) {
    obj[["call"]] <- NULL
  }
  return(obj)
}

# Casts conditions as character objects for equality purposes
condchr <- function(obj) {
  obj[["condition2"]] <- as.character(obj[["condition2"]])
  obj[["condition1"]] <- as.character(obj[["condition1"]])

  obj
}

Try the estimatr package in your browser

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

estimatr documentation built on May 29, 2024, 7:23 a.m.