R/utils.R

Defines functions release_questions remove_covtype expit logit

#' @export
# use generics to export tidy
generics::tidy

#' @export
# use generics to export glance
generics::glance

#' @export
# use generics to export augment
generics::augment

#' @export
spmodel::AICc

#' @export
spmodel::covmatrix

#' @export
spmodel::dispersion_initial

#' @export
spmodel::dispersion_params

#' @export
spmodel::glances

#' @export
spmodel::loocv

#' @export
spmodel::pseudoR2

#' @export
spmodel::randcov_initial

#' @export
spmodel::randcov_params

#' @export
spmodel::varcomp

# logit function
logit <- function(x) {
  if (x < 0 | x > 1) {
    stop("logit argument must be between zero and one", call. = FALSE)
  }
  log(x / (1 - x))
}

# expit function
expit <- function(x) {
  1 / (1 + exp(-x))
}

# remove type class
remove_covtype <- function(class_string) {
  sub("^[^_]*_", "", class_string)
}

# CRAN release questions
release_questions <- function() {
  c(
    "Have you changed version numbers in DESCRIPTION, CITATION, and README?",
    "Have you run pkgdown::build_site() and committed?"
  )
}

Try the SSN2 package in your browser

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

SSN2 documentation built on May 29, 2024, 4:41 a.m.